JSON-RPC API

Types

Bytes32HexString

"0x0000000000000000000000000000000000000000000000000000000000000000"

Event

{
  "blockNumber": Number,
  "eventIndex": Number
}

EventMeta

{
  "index": Number,
  "name": String
}

Variant

{
  "index": Number,
  "name": String,
  "events": EventMeta
}

Span

{
  "start": Number,
  "end": Number
}

SubstrateKey

{
  "type": "AccountId",
  "value": Bytes32HexString
}
{
  "type": "AccountIndex",
  "value": Number
}
{
  "type": "BountyIndex",
  "value": Number
}
{
  "type": "EraIndex",
  "value": Number
}
{
  "type": "MessageId",
  "value": Bytes32HexString
}
{
  "type": "PoolId",
  "value": Number
}
{
  "type": "PreimageHash",
  "value": Bytes32HexString
}
{
  "type": "ProposalHash",
  "value": Bytes32HexString
}
{
  "type": "ProposalIndex",
  "value": Number
}
{
  "type": "RefIndex",
  "value": Number
}
{
  "type": "RegistrarIndex",
  "value": Number
}
{
  "type": "SessionIndex",
  "value": Number
}
{
  "type": "TipHash",
  "value": Bytes32HexString
}

ChainKey

Chain specific keys defined by chain indexer implementation.

Key

{
  "type": "Variant",
  "value": [Number, Number]
}
{
  "type": "Substrate",
  "value": SubstrateKey
}
{
  "type": "Chain",
  "value": ChainKey
}

Request

Status

{
  "type": "Status"
}

Subscribe Status

{
  "type": "SubscribeStatus"
}

Unsubscribe Status

{
  "type": "UnsubscribeStatus"
}

Variants

{
  "type": "Variants"
}

Get Events

{
  "type": "GetEvents",
  "key": Key
}

Subscribe Events

{
  "type": "SubscribeEvents",
  "key": Key
}

Unsubscribe Events

{
  "type": "UnsubscribeEvents",
  "key": Key
}

Size On Disk

{
  "type": "SizeOnDisk"
}

Response

Status

{
  "type": "Status",
  "data": [Span, ...]
}

Variants

{
  "type": "Variants",
  "data": [Variant, ...]
}

Events

{
  "type": "Events",
  "key": Key,
  "data": [Event, ...]
}

Subscribed

{
  "type": "Subscribed"
}

Unsubscribed

{
  "type": "Unsubscribed"
}

Size On Disk

{
  "type": "SizeOnDisk",
  "data": Number
}