Midnight Indexer API

The Midnight Indexer API exposes a GraphQL API that enables clients to query and subscribe to blockchain data — blocks, transactions, contracts, and wallet-related events — indexed from the Midnight blockchain.

The deployed version of the Midnight Indexer API is v4.

For the raw GraphQL schema specification, see the Midnight Indexer GraphQL Schema.

API Endpoints
https://midnight-mainnet.blockfrost.io/api/v0
Headers
# Your Blockfrost project ID for Midnight Mainnet
project_id: YOUR_PROJECT_ID

Quick Start

Create a Midnight project on blockfrost.io and make your first API call:

curl -X POST https://midnight-mainnet.blockfrost.io/api/v0 \
  -H "project_id: YOUR_PROJECT_ID" \
  -H "Content-Type: application/json" \
  -d '{"query": "{ block { hash height timestamp } }"}'

Response:

{
  "data": {
    "block": {
      "hash": "d193b2686197789ace64962eb3049c5b94c4bbf9b07da04bef034cd75d83afc4",
      "height": 192998,
      "timestamp": 1770787800000
    }
  }
}

Endpoints

Blockfrost exposes three Midnight services. Available networks: mainnet, preprod, preview.

Service URL
Indexer API https://midnight-{network}.blockfrost.io/api/v0
Indexer WebSocket wss://midnight-{network}.blockfrost.io/api/v0/ws
Node RPC https://rpc.midnight-{network}.blockfrost.io

Indexer API — Send GraphQL queries and mutations over HTTP POST. This is the main entry point for fetching blockchain data (blocks, transactions, contracts, DUST status).

Indexer WebSocket — Subscribe to real-time events using the graphql-transport-ws protocol. Supports block streaming, contract actions, shielded/unshielded transactions, and ledger events.

Node RPC — Direct JSON-RPC connection to the Midnight Node for low-level runtime access, wallet providers, and transaction submission. Use it with libraries like midnight.js that need a node connection.

Authentication

All requests require a valid project ID. There are two ways to pass it:

HTTP header

Include project_id as a request header.

curl -X POST https://midnight-mainnet.blockfrost.io/api/v0 \
  -H "project_id: YOUR_PROJECT_ID" \
  -H "Content-Type: application/json" \
  -d '{"query": "{ block { hash height } }"}'

Query parameter

Append ?project_id=YOUR_PROJECT_ID to the endpoint URL. Use this when your client doesn't support setting custom headers (e.g. Midnight.js SDK).

https://midnight-{network}.blockfrost.io/api/v0?project_id=YOUR_PROJECT_ID
wss://midnight-{network}.blockfrost.io/api/v0/ws?project_id=YOUR_PROJECT_ID
https://rpc.midnight-{network}.blockfrost.io?project_id=YOUR_PROJECT_ID

Replace {network} with mainnet, preprod, or preview.

Request Format

Send a POST request with a JSON body containing:

  • query (required): The GraphQL query, mutation, or subscription string
  • variables (optional): Variables for the GraphQL operation

Example:

{
  "query": "query GetBlock(: BlockOffset) { block(offset: ) { hash height } }",
  "variables": { "offset": { "height": 100 } }
}

or without variables:

{
  "query": "query { block(offset: { height: 100 }) { hash height } }"
}

Response Format

Responses follow the standard GraphQL format:

{
  "data": {
    "block": {
      "hash": "d193b2686197789ace64962eb3049c5b94c4bbf9b07da04bef034cd75d83afc4",
      "height": 192998,
      "timestamp": 1770787800000
    }
  }
}

On error:

{
  "data": null,
  "errors": [
    {
      "message": "Invalid value for argument \"offset.height\" expected type \"Int\"",
      "locations": [{ "line": 1, "column": 15 }],
      "path": ["block"]
    }
  ]
}

HTTP Query Examples

Query the latest block:

curl -X POST https://midnight-mainnet.blockfrost.io/api/v0 \
  -H "project_id: YOUR_PROJECT_ID" \
  -H "Content-Type: application/json" \
  -d '{"query": "{ block { hash height timestamp author transactions { hash } } }"}'

Query a block by height:

curl -X POST https://midnight-mainnet.blockfrost.io/api/v0 \
  -H "project_id: YOUR_PROJECT_ID" \
  -H "Content-Type: application/json" \
  -d '{"query": "{ block(offset: { height: 3 }) { hash height protocolVersion timestamp transactions { hash } } }"}'

Query transactions by hash:

curl -X POST https://midnight-mainnet.blockfrost.io/api/v0 \
  -H "project_id: YOUR_PROJECT_ID" \
  -H "Content-Type: application/json" \
  -d '{"query": "{ transactions(offset: { hash: \"YOUR_TX_HASH\" }) { hash protocolVersion fees { paidFees estimatedFees } block { height hash } } }"}'

Query DUST generation status:

curl -X POST https://midnight-mainnet.blockfrost.io/api/v0 \
  -H "project_id: YOUR_PROJECT_ID" \
  -H "Content-Type: application/json" \
  -d '{"query": "{ dustGenerationStatus(cardanoRewardAddresses: [\"YOUR_CARDANO_REWARD_ADDRESS\"]) { cardanoRewardAddress dustAddress registered nightBalance generationRate currentCapacity } }"}'

Query contract actions:

curl -X POST https://midnight-mainnet.blockfrost.io/api/v0 \
  -H "project_id: YOUR_PROJECT_ID" \
  -H "Content-Type: application/json" \
  -d '{"query": "{ contractAction(address: \"YOUR_CONTRACT_ADDRESS\") { address state transaction { hash } unshieldedBalances { tokenType amount } } }"}'

WebSocket Subscriptions

Subscriptions use a WebSocket connection following the GraphQL over WebSocket protocol.

Most subscriptions accept an optional offset parameter, allowing you to resume from a specific block height or transaction hash instead of starting from the tip. This is useful for catching up after a reconnect without re-processing events you've already seen.

Connecting with websocat:

websocat wss://midnight-mainnet.blockfrost.io/api/v0/ws \
  --protocol "graphql-transport-ws" \
  -H "project_id: YOUR_PROJECT_ID"

Step 1 — Initialize the connection:

After connecting, send a connection_init message:

{"type": "connection_init"}

The server responds with:

{"type": "connection_ack"}

Step 2 — Send a subscription:

Once acknowledged, send a subscribe message with your GraphQL subscription query:

{
  "id": "1",
  "type": "subscribe",
  "payload": {
    "query": "subscription { blocks { hash height timestamp transactions { hash } } }"
  }
}

Step 3 — Receive events:

The server pushes next messages whenever new data is available:

{
  "id": "1",
  "type": "next",
  "payload": {
    "data": {
      "blocks": {
        "hash": "d193b2686197789ace64962eb3049c5b94c4bbf9b07da04bef034cd75d83afc4",
        "height": 192998,
        "timestamp": 1770787800000,
        "transactions": []
      }
    }
  }
}

Connecting from JavaScript:

const url = "wss://midnight-mainnet.blockfrost.io/api/v0/ws?project_id=YOUR_PROJECT_ID";
            const ws = new WebSocket(url, "graphql-transport-ws");
            
            ws.onopen = () => {
              ws.send(JSON.stringify({ type: "connection_init" }));
            };
            
            ws.onmessage = (event) => {
              const msg = JSON.parse(event.data);
            
              if (msg.type === "connection_ack") {
                ws.send(
                  JSON.stringify({
                    id: "1",
                    type: "subscribe",
                    payload: {
                      query: "subscription { blocks { hash height timestamp } }",
                    },
                  })
                );
              }
            
              if (msg.type === "next") {
                console.log("New block:", msg.payload.data);
              }
            };
            

Query Limits

The server may apply limitations to queries:

  • max-depth: Maximum nesting depth
  • max-fields: Maximum number of fields
  • timeout: Query execution timeout
  • complexity: Query complexity cost

Requests exceeding limits return errors:

{
  "data": null,
  "errors": [{ "message": "Query has too many fields: 20. Max fields: 10." }]
}

Pagination with Offsets

Many queries support offsets for pagination:

BlockOffset (oneOf — provide exactly one):

  • hash: Hex-encoded block hash
  • height: Block height number

TransactionOffset (oneOf — provide exactly one):

  • hash: Hex-encoded transaction hash
  • identifier: Hex-encoded transaction identifier

ContractActionOffset (oneOf — provide exactly one):

  • blockOffset: A BlockOffset
  • transactionOffset: A TransactionOffset

If no offset is provided, the latest result is returned.

Shielded Transactions

Shielded transactions are at the core of Midnight's privacy model. Because transaction data is encrypted on-chain, the indexer needs a viewing key to determine which transactions are relevant to a specific wallet.

The connect mutation establishes a server-side session for a given viewing key. The indexer uses this key to scan the chain and filter shielded transactions relevant to that wallet. It returns a session ID used to authenticate the shieldedTransactions subscription.

When you no longer need to monitor shielded transactions for a wallet, call the disconnect mutation with the session ID to end the session and free server-side resources.

Step 1 — Connect with a viewing key:

curl -X POST https://midnight-mainnet.blockfrost.io/api/v0 \
  -H "project_id: YOUR_PROJECT_ID" \
  -H "Content-Type: application/json" \
  -d '{"query": "mutation { connect(viewingKey: \"YOUR_VIEWING_KEY\") }"}'

Response:

{
  "data": {
    "connect": "SESSION_ID_HEX"
  }
}

The viewing key can be in Bech32m format (preferred, e.g. mn_shield-esk1...) or hex.

Step 2 — Subscribe to shielded transactions:

Using the session ID from the connect mutation, subscribe via WebSocket:

{
  "id": "1",
  "type": "subscribe",
  "payload": {
    "query": "subscription(: HexEncoded!) { shieldedTransactions(sessionId: , sendProgressUpdates: true) { ... on ViewingUpdate { index update { ... on RelevantTransaction { transaction { hash } } } } ... on ShieldedTransactionsProgress { highestIndex highestRelevantIndex highestRelevantWalletIndex } } }",
    "variables": { "sid": "SESSION_ID_HEX" }
  }
}

The subscription emits two event types:

  • ViewingUpdate — contains relevant transactions and Merkle tree updates for the wallet
  • ShieldedTransactionsProgress — reports sync progress (highestIndex, highestRelevantIndex, highestRelevantWalletIndex), useful for showing progress in a UI. Controlled by the sendProgressUpdates parameter (default: true).

Step 3 — Disconnect when done:

curl -X POST https://midnight-mainnet.blockfrost.io/api/v0 \
  -H "project_id: YOUR_PROJECT_ID" \
  -H "Content-Type: application/json" \
  -d '{"query": "mutation { disconnect(sessionId: \"SESSION_ID_HEX\") }"}'

Other Subscriptions

Besides blocks and shieldedTransactions, the following subscriptions are available:

  • contractActions(address: HexEncoded!, offset: BlockOffset) — real-time contract events (deploys, calls, updates) for a specific contract address
  • unshieldedTransactions(address: UnshieldedAddress!, transactionId: Int) — unshielded transaction events for an address, with optional resume from a specific transaction ID
  • dustLedgerEvents(id: Int) — DUST ledger state changes (initial UTXOs, generation time updates, spend processing, parameter changes)
  • zswapLedgerEvents(id: Int) — zswap ledger state changes

Resources

For more information about the Midnight Indexer API, see the official Midnight documentation.

Queries

block

Description

Find a block for the given optional offset; if not present, the latest block is returned.

Response

Returns a Block

Arguments
Name Description
offset - BlockOffset

Example

Query
query Block($offset: BlockOffset) {
  block(offset: $offset) {
    hash
    height
    protocolVersion
    timestamp
    author
    ledgerParameters
    parent {
      hash
      height
      protocolVersion
      timestamp
      author
      ledgerParameters
      parent {
        hash
        height
        protocolVersion
        timestamp
        author
        ledgerParameters
        parent {
          ...BlockFragment
        }
        transactions {
          ...TransactionFragment
        }
        systemParameters {
          ...SystemParametersFragment
        }
      }
      transactions {
        id
        hash
        protocolVersion
        raw
        block {
          ...BlockFragment
        }
        contractActions {
          ...ContractActionFragment
        }
        unshieldedCreatedOutputs {
          ...UnshieldedUtxoFragment
        }
        unshieldedSpentOutputs {
          ...UnshieldedUtxoFragment
        }
        zswapLedgerEvents {
          ...ZswapLedgerEventFragment
        }
        dustLedgerEvents {
          ...DustLedgerEventFragment
        }
      }
      systemParameters {
        dParameter {
          ...DParameterFragment
        }
        termsAndConditions {
          ...TermsAndConditionsFragment
        }
      }
    }
    transactions {
      id
      hash
      protocolVersion
      raw
      block {
        hash
        height
        protocolVersion
        timestamp
        author
        ledgerParameters
        parent {
          ...BlockFragment
        }
        transactions {
          ...TransactionFragment
        }
        systemParameters {
          ...SystemParametersFragment
        }
      }
      contractActions {
        address
        state
        zswapState
        transaction {
          ...TransactionFragment
        }
        unshieldedBalances {
          ...ContractBalanceFragment
        }
      }
      unshieldedCreatedOutputs {
        owner
        tokenType
        value
        intentHash
        outputIndex
        ctime
        initialNonce
        registeredForDustGeneration
        createdAtTransaction {
          ...TransactionFragment
        }
        spentAtTransaction {
          ...TransactionFragment
        }
      }
      unshieldedSpentOutputs {
        owner
        tokenType
        value
        intentHash
        outputIndex
        ctime
        initialNonce
        registeredForDustGeneration
        createdAtTransaction {
          ...TransactionFragment
        }
        spentAtTransaction {
          ...TransactionFragment
        }
      }
      zswapLedgerEvents {
        id
        raw
        maxId
        protocolVersion
      }
      dustLedgerEvents {
        id
        raw
        maxId
        protocolVersion
      }
    }
    systemParameters {
      dParameter {
        numPermissionedCandidates
        numRegisteredCandidates
      }
      termsAndConditions {
        hash
        url
      }
    }
  }
}
Variables
{"offset": BlockOffset}
Response
{
  "data": {
    "block": {
      "hash": HexEncoded,
      "height": 123,
      "protocolVersion": 987,
      "timestamp": 123,
      "author": HexEncoded,
      "ledgerParameters": HexEncoded,
      "parent": Block,
      "transactions": [Transaction],
      "systemParameters": SystemParameters
    }
  }
}

committee

Description

Get committee membership for an epoch.

Response

Returns [CommitteeMember!]!

Arguments
Name Description
epoch - Int!

Example

Query
query Committee($epoch: Int!) {
  committee(epoch: $epoch) {
    epochNo
    position
    sidechainPubkeyHex
    expectedSlots
    auraPubkeyHex
    poolIdHex
    spoSkHex
  }
}
Variables
{"epoch": 123}
Response
{
  "data": {
    "committee": [
      {
        "epochNo": 123,
        "position": 987,
        "sidechainPubkeyHex": "xyz789",
        "expectedSlots": 987,
        "auraPubkeyHex": "abc123",
        "poolIdHex": "abc123",
        "spoSkHex": "xyz789"
      }
    ]
  }
}

contractAction

Description

Find a contract action for the given address and optional offset.

Response

Returns a ContractAction

Arguments
Name Description
address - HexEncoded!
offset - ContractActionOffset

Example

Query
query ContractAction(
  $address: HexEncoded!,
  $offset: ContractActionOffset
) {
  contractAction(
    address: $address,
    offset: $offset
  ) {
    address
    state
    zswapState
    transaction {
      id
      hash
      protocolVersion
      raw
      block {
        hash
        height
        protocolVersion
        timestamp
        author
        ledgerParameters
        parent {
          ...BlockFragment
        }
        transactions {
          ...TransactionFragment
        }
        systemParameters {
          ...SystemParametersFragment
        }
      }
      contractActions {
        address
        state
        zswapState
        transaction {
          ...TransactionFragment
        }
        unshieldedBalances {
          ...ContractBalanceFragment
        }
      }
      unshieldedCreatedOutputs {
        owner
        tokenType
        value
        intentHash
        outputIndex
        ctime
        initialNonce
        registeredForDustGeneration
        createdAtTransaction {
          ...TransactionFragment
        }
        spentAtTransaction {
          ...TransactionFragment
        }
      }
      unshieldedSpentOutputs {
        owner
        tokenType
        value
        intentHash
        outputIndex
        ctime
        initialNonce
        registeredForDustGeneration
        createdAtTransaction {
          ...TransactionFragment
        }
        spentAtTransaction {
          ...TransactionFragment
        }
      }
      zswapLedgerEvents {
        id
        raw
        maxId
        protocolVersion
      }
      dustLedgerEvents {
        id
        raw
        maxId
        protocolVersion
      }
    }
    unshieldedBalances {
      tokenType
      amount
    }
  }
}
Variables
{
  "address": HexEncoded,
  "offset": ContractActionOffset
}
Response
{
  "data": {
    "contractAction": {
      "address": HexEncoded,
      "state": HexEncoded,
      "zswapState": HexEncoded,
      "transaction": Transaction,
      "unshieldedBalances": [ContractBalance]
    }
  }
}

currentEpochInfo

Description

Get current epoch information.

Response

Returns an EpochInfo

Example

Query
query CurrentEpochInfo {
  currentEpochInfo {
    epochNo
    durationSeconds
    elapsedSeconds
  }
}
Response
{
  "data": {
    "currentEpochInfo": {
      "epochNo": 123,
      "durationSeconds": 987,
      "elapsedSeconds": 987
    }
  }
}

dParameterHistory

Description

Get the full history of D-parameter changes for governance auditability.

Response

Returns [DParameterChange!]!

Example

Query
query DParameterHistory {
  dParameterHistory {
    blockHeight
    blockHash
    timestamp
    numPermissionedCandidates
    numRegisteredCandidates
  }
}
Response
{
  "data": {
    "dParameterHistory": [
      {
        "blockHeight": 123,
        "blockHash": HexEncoded,
        "timestamp": 987,
        "numPermissionedCandidates": 987,
        "numRegisteredCandidates": 123
      }
    ]
  }
}

dustGenerationStatus

Description

Get DUST generation status for specific Cardano reward addresses.

Response

Returns [DustGenerationStatus!]!

Arguments
Name Description
cardanoRewardAddresses - [CardanoRewardAddress!]!

Example

Query
query DustGenerationStatus($cardanoRewardAddresses: [CardanoRewardAddress!]!) {
  dustGenerationStatus(cardanoRewardAddresses: $cardanoRewardAddresses) {
    cardanoRewardAddress
    dustAddress
    registered
    nightBalance
    generationRate
    maxCapacity
    currentCapacity
    utxoTxHash
    utxoOutputIndex
  }
}
Variables
{"cardanoRewardAddresses": [CardanoRewardAddress]}
Response
{
  "data": {
    "dustGenerationStatus": [
      {
        "cardanoRewardAddress": CardanoRewardAddress,
        "dustAddress": DustAddress,
        "registered": true,
        "nightBalance": "abc123",
        "generationRate": "xyz789",
        "maxCapacity": "xyz789",
        "currentCapacity": "abc123",
        "utxoTxHash": HexEncoded,
        "utxoOutputIndex": 987
      }
    ]
  }
}

epochPerformance

Description

Get epoch performance for all SPOs.

Response

Returns [EpochPerf!]!

Arguments
Name Description
epoch - Int!
limit - Int
offset - Int

Example

Query
query EpochPerformance(
  $epoch: Int!,
  $limit: Int,
  $offset: Int
) {
  epochPerformance(
    epoch: $epoch,
    limit: $limit,
    offset: $offset
  ) {
    epochNo
    spoSkHex
    produced
    expected
    identityLabel
    stakeSnapshot
    poolIdHex
    validatorClass
  }
}
Variables
{"epoch": 123, "limit": 123, "offset": 123}
Response
{
  "data": {
    "epochPerformance": [
      {
        "epochNo": 123,
        "spoSkHex": "xyz789",
        "produced": 123,
        "expected": 123,
        "identityLabel": "xyz789",
        "stakeSnapshot": "abc123",
        "poolIdHex": "abc123",
        "validatorClass": "abc123"
      }
    ]
  }
}

epochUtilization

Description

Get epoch utilization (produced/expected ratio).

Response

Returns a Float

Arguments
Name Description
epoch - Int!

Example

Query
query EpochUtilization($epoch: Int!) {
  epochUtilization(epoch: $epoch)
}
Variables
{"epoch": 987}
Response
{"data": {"epochUtilization": 987.65}}

poolMetadata

Description

Get pool metadata by pool ID.

Response

Returns a PoolMetadata

Arguments
Name Description
poolIdHex - String!

Example

Query
query PoolMetadata($poolIdHex: String!) {
  poolMetadata(poolIdHex: $poolIdHex) {
    poolIdHex
    hexId
    name
    ticker
    homepageUrl
    logoUrl
  }
}
Variables
{"poolIdHex": "abc123"}
Response
{
  "data": {
    "poolMetadata": {
      "poolIdHex": "abc123",
      "hexId": "xyz789",
      "name": "xyz789",
      "ticker": "xyz789",
      "homepageUrl": "abc123",
      "logoUrl": "abc123"
    }
  }
}

poolMetadataList

Description

List pool metadata with pagination.

Response

Returns [PoolMetadata!]!

Arguments
Name Description
limit - Int
offset - Int
withNameOnly - Boolean

Example

Query
query PoolMetadataList(
  $limit: Int,
  $offset: Int,
  $withNameOnly: Boolean
) {
  poolMetadataList(
    limit: $limit,
    offset: $offset,
    withNameOnly: $withNameOnly
  ) {
    poolIdHex
    hexId
    name
    ticker
    homepageUrl
    logoUrl
  }
}
Variables
{"limit": 123, "offset": 987, "withNameOnly": false}
Response
{
  "data": {
    "poolMetadataList": [
      {
        "poolIdHex": "xyz789",
        "hexId": "xyz789",
        "name": "xyz789",
        "ticker": "abc123",
        "homepageUrl": "xyz789",
        "logoUrl": "abc123"
      }
    ]
  }
}

registeredFirstValidEpochs

Description

Get first valid epoch for each SPO identity.

Response

Returns [FirstValidEpoch!]!

Arguments
Name Description
uptoEpoch - Int

Example

Query
query RegisteredFirstValidEpochs($uptoEpoch: Int) {
  registeredFirstValidEpochs(uptoEpoch: $uptoEpoch) {
    idKey
    firstValidEpoch
  }
}
Variables
{"uptoEpoch": 987}
Response
{
  "data": {
    "registeredFirstValidEpochs": [
      {
        "idKey": "abc123",
        "firstValidEpoch": 987
      }
    ]
  }
}

registeredPresence

Description

Get raw presence events for an epoch range.

Response

Returns [PresenceEvent!]!

Arguments
Name Description
fromEpoch - Int!
toEpoch - Int!

Example

Query
query RegisteredPresence(
  $fromEpoch: Int!,
  $toEpoch: Int!
) {
  registeredPresence(
    fromEpoch: $fromEpoch,
    toEpoch: $toEpoch
  ) {
    epochNo
    idKey
    source
    status
  }
}
Variables
{"fromEpoch": 123, "toEpoch": 123}
Response
{
  "data": {
    "registeredPresence": [
      {
        "epochNo": 987,
        "idKey": "abc123",
        "source": "abc123",
        "status": "abc123"
      }
    ]
  }
}

registeredSpoSeries

Description

Get registration statistics for an epoch range.

Response

Returns [RegisteredStat!]!

Arguments
Name Description
fromEpoch - Int!
toEpoch - Int!

Example

Query
query RegisteredSpoSeries(
  $fromEpoch: Int!,
  $toEpoch: Int!
) {
  registeredSpoSeries(
    fromEpoch: $fromEpoch,
    toEpoch: $toEpoch
  ) {
    epochNo
    federatedValidCount
    federatedInvalidCount
    registeredValidCount
    registeredInvalidCount
    dparam
  }
}
Variables
{"fromEpoch": 123, "toEpoch": 123}
Response
{
  "data": {
    "registeredSpoSeries": [
      {
        "epochNo": 987,
        "federatedValidCount": 987,
        "federatedInvalidCount": 123,
        "registeredValidCount": 123,
        "registeredInvalidCount": 123,
        "dparam": 123.45
      }
    ]
  }
}

registeredTotalsSeries

Description

Get cumulative registration totals for an epoch range.

Response

Returns [RegisteredTotals!]!

Arguments
Name Description
fromEpoch - Int!
toEpoch - Int!

Example

Query
query RegisteredTotalsSeries(
  $fromEpoch: Int!,
  $toEpoch: Int!
) {
  registeredTotalsSeries(
    fromEpoch: $fromEpoch,
    toEpoch: $toEpoch
  ) {
    epochNo
    totalRegistered
    newlyRegistered
  }
}
Variables
{"fromEpoch": 123, "toEpoch": 123}
Response
{
  "data": {
    "registeredTotalsSeries": [
      {"epochNo": 123, "totalRegistered": 987, "newlyRegistered": 123}
    ]
  }
}

spoByPoolId

Description

Get SPO with metadata by pool ID.

Response

Returns a Spo

Arguments
Name Description
poolIdHex - String!

Example

Query
query SpoByPoolId($poolIdHex: String!) {
  spoByPoolId(poolIdHex: $poolIdHex) {
    poolIdHex
    validatorClass
    sidechainPubkeyHex
    auraPubkeyHex
    name
    ticker
    homepageUrl
    logoUrl
  }
}
Variables
{"poolIdHex": "xyz789"}
Response
{
  "data": {
    "spoByPoolId": {
      "poolIdHex": "xyz789",
      "validatorClass": "xyz789",
      "sidechainPubkeyHex": "abc123",
      "auraPubkeyHex": "xyz789",
      "name": "abc123",
      "ticker": "xyz789",
      "homepageUrl": "xyz789",
      "logoUrl": "xyz789"
    }
  }
}

spoCompositeByPoolId

Description

Get composite SPO data (identity + metadata + performance).

Response

Returns a SpoComposite

Arguments
Name Description
poolIdHex - String!

Example

Query
query SpoCompositeByPoolId($poolIdHex: String!) {
  spoCompositeByPoolId(poolIdHex: $poolIdHex) {
    identity {
      poolIdHex
      mainchainPubkeyHex
      sidechainPubkeyHex
      auraPubkeyHex
      validatorClass
    }
    metadata {
      poolIdHex
      hexId
      name
      ticker
      homepageUrl
      logoUrl
    }
    performance {
      epochNo
      spoSkHex
      produced
      expected
      identityLabel
      stakeSnapshot
      poolIdHex
      validatorClass
    }
  }
}
Variables
{"poolIdHex": "abc123"}
Response
{
  "data": {
    "spoCompositeByPoolId": {
      "identity": SpoIdentity,
      "metadata": PoolMetadata,
      "performance": [EpochPerf]
    }
  }
}

spoCount

Description

Get total count of SPOs.

Response

Returns an Int

Example

Query
query SpoCount {
  spoCount
}
Response
{"data": {"spoCount": 987}}

spoIdentities

Description

List SPO identities with pagination.

Response

Returns [SpoIdentity!]!

Arguments
Name Description
limit - Int
offset - Int

Example

Query
query SpoIdentities(
  $limit: Int,
  $offset: Int
) {
  spoIdentities(
    limit: $limit,
    offset: $offset
  ) {
    poolIdHex
    mainchainPubkeyHex
    sidechainPubkeyHex
    auraPubkeyHex
    validatorClass
  }
}
Variables
{"limit": 123, "offset": 987}
Response
{
  "data": {
    "spoIdentities": [
      {
        "poolIdHex": "xyz789",
        "mainchainPubkeyHex": "xyz789",
        "sidechainPubkeyHex": "xyz789",
        "auraPubkeyHex": "abc123",
        "validatorClass": "xyz789"
      }
    ]
  }
}

spoIdentityByPoolId

Description

Get SPO identity by pool ID.

Response

Returns a SpoIdentity

Arguments
Name Description
poolIdHex - String!

Example

Query
query SpoIdentityByPoolId($poolIdHex: String!) {
  spoIdentityByPoolId(poolIdHex: $poolIdHex) {
    poolIdHex
    mainchainPubkeyHex
    sidechainPubkeyHex
    auraPubkeyHex
    validatorClass
  }
}
Variables
{"poolIdHex": "abc123"}
Response
{
  "data": {
    "spoIdentityByPoolId": {
      "poolIdHex": "abc123",
      "mainchainPubkeyHex": "xyz789",
      "sidechainPubkeyHex": "abc123",
      "auraPubkeyHex": "xyz789",
      "validatorClass": "xyz789"
    }
  }
}

spoList

Description

List SPOs with optional search.

Response

Returns [Spo!]!

Arguments
Name Description
limit - Int
offset - Int
search - String

Example

Query
query SpoList(
  $limit: Int,
  $offset: Int,
  $search: String
) {
  spoList(
    limit: $limit,
    offset: $offset,
    search: $search
  ) {
    poolIdHex
    validatorClass
    sidechainPubkeyHex
    auraPubkeyHex
    name
    ticker
    homepageUrl
    logoUrl
  }
}
Variables
{
  "limit": 987,
  "offset": 987,
  "search": "abc123"
}
Response
{
  "data": {
    "spoList": [
      {
        "poolIdHex": "xyz789",
        "validatorClass": "xyz789",
        "sidechainPubkeyHex": "xyz789",
        "auraPubkeyHex": "xyz789",
        "name": "abc123",
        "ticker": "abc123",
        "homepageUrl": "xyz789",
        "logoUrl": "abc123"
      }
    ]
  }
}

spoPerformanceBySpoSk

Description

Get SPO performance by SPO key.

Response

Returns [EpochPerf!]!

Arguments
Name Description
spoSkHex - String!
limit - Int
offset - Int

Example

Query
query SpoPerformanceBySpoSk(
  $spoSkHex: String!,
  $limit: Int,
  $offset: Int
) {
  spoPerformanceBySpoSk(
    spoSkHex: $spoSkHex,
    limit: $limit,
    offset: $offset
  ) {
    epochNo
    spoSkHex
    produced
    expected
    identityLabel
    stakeSnapshot
    poolIdHex
    validatorClass
  }
}
Variables
{
  "spoSkHex": "xyz789",
  "limit": 123,
  "offset": 987
}
Response
{
  "data": {
    "spoPerformanceBySpoSk": [
      {
        "epochNo": 123,
        "spoSkHex": "xyz789",
        "produced": 987,
        "expected": 123,
        "identityLabel": "abc123",
        "stakeSnapshot": "xyz789",
        "poolIdHex": "abc123",
        "validatorClass": "abc123"
      }
    ]
  }
}

spoPerformanceLatest

Description

Get latest SPO performance entries.

Response

Returns [EpochPerf!]!

Arguments
Name Description
limit - Int
offset - Int

Example

Query
query SpoPerformanceLatest(
  $limit: Int,
  $offset: Int
) {
  spoPerformanceLatest(
    limit: $limit,
    offset: $offset
  ) {
    epochNo
    spoSkHex
    produced
    expected
    identityLabel
    stakeSnapshot
    poolIdHex
    validatorClass
  }
}
Variables
{"limit": 987, "offset": 987}
Response
{
  "data": {
    "spoPerformanceLatest": [
      {
        "epochNo": 123,
        "spoSkHex": "xyz789",
        "produced": 123,
        "expected": 987,
        "identityLabel": "abc123",
        "stakeSnapshot": "abc123",
        "poolIdHex": "xyz789",
        "validatorClass": "abc123"
      }
    ]
  }
}

stakeDistribution

Description

Get stake distribution with search and ordering.

Response

Returns [StakeShare!]!

Arguments
Name Description
limit - Int
offset - Int
search - String
orderByStakeDesc - Boolean

Example

Query
query StakeDistribution(
  $limit: Int,
  $offset: Int,
  $search: String,
  $orderByStakeDesc: Boolean
) {
  stakeDistribution(
    limit: $limit,
    offset: $offset,
    search: $search,
    orderByStakeDesc: $orderByStakeDesc
  ) {
    poolIdHex
    name
    ticker
    homepageUrl
    logoUrl
    liveStake
    activeStake
    liveDelegators
    liveSaturation
    declaredPledge
    livePledge
    stakeShare
  }
}
Variables
{
  "limit": 123,
  "offset": 123,
  "search": "xyz789",
  "orderByStakeDesc": false
}
Response
{
  "data": {
    "stakeDistribution": [
      {
        "poolIdHex": "abc123",
        "name": "abc123",
        "ticker": "xyz789",
        "homepageUrl": "abc123",
        "logoUrl": "abc123",
        "liveStake": "abc123",
        "activeStake": "abc123",
        "liveDelegators": 987,
        "liveSaturation": 123.45,
        "declaredPledge": "abc123",
        "livePledge": "abc123",
        "stakeShare": 987.65
      }
    ]
  }
}

stakePoolOperators

Description

Get SPO identifiers ordered by performance.

Response

Returns [String!]!

Arguments
Name Description
limit - Int

Example

Query
query StakePoolOperators($limit: Int) {
  stakePoolOperators(limit: $limit)
}
Variables
{"limit": 987}
Response
{"data": {"stakePoolOperators": ["abc123"]}}

termsAndConditionsHistory

Description

Get the full history of Terms and Conditions changes for governance auditability.

Response

Returns [TermsAndConditionsChange!]!

Example

Query
query TermsAndConditionsHistory {
  termsAndConditionsHistory {
    blockHeight
    blockHash
    timestamp
    hash
    url
  }
}
Response
{
  "data": {
    "termsAndConditionsHistory": [
      {
        "blockHeight": 987,
        "blockHash": HexEncoded,
        "timestamp": 987,
        "hash": HexEncoded,
        "url": "abc123"
      }
    ]
  }
}

transactions

Description

Find transactions for the given offset.

Response

Returns [Transaction!]!

Arguments
Name Description
offset - TransactionOffset!

Example

Query
query Transactions($offset: TransactionOffset!) {
  transactions(offset: $offset) {
    id
    hash
    protocolVersion
    raw
    block {
      hash
      height
      protocolVersion
      timestamp
      author
      ledgerParameters
      parent {
        hash
        height
        protocolVersion
        timestamp
        author
        ledgerParameters
        parent {
          ...BlockFragment
        }
        transactions {
          ...TransactionFragment
        }
        systemParameters {
          ...SystemParametersFragment
        }
      }
      transactions {
        id
        hash
        protocolVersion
        raw
        block {
          ...BlockFragment
        }
        contractActions {
          ...ContractActionFragment
        }
        unshieldedCreatedOutputs {
          ...UnshieldedUtxoFragment
        }
        unshieldedSpentOutputs {
          ...UnshieldedUtxoFragment
        }
        zswapLedgerEvents {
          ...ZswapLedgerEventFragment
        }
        dustLedgerEvents {
          ...DustLedgerEventFragment
        }
      }
      systemParameters {
        dParameter {
          ...DParameterFragment
        }
        termsAndConditions {
          ...TermsAndConditionsFragment
        }
      }
    }
    contractActions {
      address
      state
      zswapState
      transaction {
        id
        hash
        protocolVersion
        raw
        block {
          ...BlockFragment
        }
        contractActions {
          ...ContractActionFragment
        }
        unshieldedCreatedOutputs {
          ...UnshieldedUtxoFragment
        }
        unshieldedSpentOutputs {
          ...UnshieldedUtxoFragment
        }
        zswapLedgerEvents {
          ...ZswapLedgerEventFragment
        }
        dustLedgerEvents {
          ...DustLedgerEventFragment
        }
      }
      unshieldedBalances {
        tokenType
        amount
      }
    }
    unshieldedCreatedOutputs {
      owner
      tokenType
      value
      intentHash
      outputIndex
      ctime
      initialNonce
      registeredForDustGeneration
      createdAtTransaction {
        id
        hash
        protocolVersion
        raw
        block {
          ...BlockFragment
        }
        contractActions {
          ...ContractActionFragment
        }
        unshieldedCreatedOutputs {
          ...UnshieldedUtxoFragment
        }
        unshieldedSpentOutputs {
          ...UnshieldedUtxoFragment
        }
        zswapLedgerEvents {
          ...ZswapLedgerEventFragment
        }
        dustLedgerEvents {
          ...DustLedgerEventFragment
        }
      }
      spentAtTransaction {
        id
        hash
        protocolVersion
        raw
        block {
          ...BlockFragment
        }
        contractActions {
          ...ContractActionFragment
        }
        unshieldedCreatedOutputs {
          ...UnshieldedUtxoFragment
        }
        unshieldedSpentOutputs {
          ...UnshieldedUtxoFragment
        }
        zswapLedgerEvents {
          ...ZswapLedgerEventFragment
        }
        dustLedgerEvents {
          ...DustLedgerEventFragment
        }
      }
    }
    unshieldedSpentOutputs {
      owner
      tokenType
      value
      intentHash
      outputIndex
      ctime
      initialNonce
      registeredForDustGeneration
      createdAtTransaction {
        id
        hash
        protocolVersion
        raw
        block {
          ...BlockFragment
        }
        contractActions {
          ...ContractActionFragment
        }
        unshieldedCreatedOutputs {
          ...UnshieldedUtxoFragment
        }
        unshieldedSpentOutputs {
          ...UnshieldedUtxoFragment
        }
        zswapLedgerEvents {
          ...ZswapLedgerEventFragment
        }
        dustLedgerEvents {
          ...DustLedgerEventFragment
        }
      }
      spentAtTransaction {
        id
        hash
        protocolVersion
        raw
        block {
          ...BlockFragment
        }
        contractActions {
          ...ContractActionFragment
        }
        unshieldedCreatedOutputs {
          ...UnshieldedUtxoFragment
        }
        unshieldedSpentOutputs {
          ...UnshieldedUtxoFragment
        }
        zswapLedgerEvents {
          ...ZswapLedgerEventFragment
        }
        dustLedgerEvents {
          ...DustLedgerEventFragment
        }
      }
    }
    zswapLedgerEvents {
      id
      raw
      maxId
      protocolVersion
    }
    dustLedgerEvents {
      id
      raw
      maxId
      protocolVersion
    }
  }
}
Variables
{"offset": TransactionOffset}
Response
{
  "data": {
    "transactions": [
      {
        "id": 987,
        "hash": HexEncoded,
        "protocolVersion": 123,
        "raw": HexEncoded,
        "block": Block,
        "contractActions": [ContractAction],
        "unshieldedCreatedOutputs": [UnshieldedUtxo],
        "unshieldedSpentOutputs": [UnshieldedUtxo],
        "zswapLedgerEvents": [ZswapLedgerEvent],
        "dustLedgerEvents": [DustLedgerEvent]
      }
    ]
  }
}

Mutations

connect

Description

Connect the wallet with the given viewing key and return a session ID.

Response

Returns a HexEncoded!

Arguments
Name Description
viewingKey - ViewingKey!

Example

Query
mutation Connect($viewingKey: ViewingKey!) {
  connect(viewingKey: $viewingKey)
}
Variables
{"viewingKey": ViewingKey}
Response
{"data": {"connect": HexEncoded}}

disconnect

Description

Disconnect the wallet with the given session ID.

Response

Returns a Unit!

Arguments
Name Description
sessionId - HexEncoded!

Example

Query
mutation Disconnect($sessionId: HexEncoded!) {
  disconnect(sessionId: $sessionId)
}
Variables
{"sessionId": HexEncoded}
Response
{"data": {"disconnect": Unit}}

Subscriptions

blocks

Description

Subscribe to blocks starting at the given offset or at the latest block if the offset is omitted.

Response

Returns a Block!

Arguments
Name Description
offset - BlockOffset

Example

Query
subscription Blocks($offset: BlockOffset) {
  blocks(offset: $offset) {
    hash
    height
    protocolVersion
    timestamp
    author
    ledgerParameters
    parent {
      hash
      height
      protocolVersion
      timestamp
      author
      ledgerParameters
      parent {
        hash
        height
        protocolVersion
        timestamp
        author
        ledgerParameters
        parent {
          ...BlockFragment
        }
        transactions {
          ...TransactionFragment
        }
        systemParameters {
          ...SystemParametersFragment
        }
      }
      transactions {
        id
        hash
        protocolVersion
        raw
        block {
          ...BlockFragment
        }
        contractActions {
          ...ContractActionFragment
        }
        unshieldedCreatedOutputs {
          ...UnshieldedUtxoFragment
        }
        unshieldedSpentOutputs {
          ...UnshieldedUtxoFragment
        }
        zswapLedgerEvents {
          ...ZswapLedgerEventFragment
        }
        dustLedgerEvents {
          ...DustLedgerEventFragment
        }
      }
      systemParameters {
        dParameter {
          ...DParameterFragment
        }
        termsAndConditions {
          ...TermsAndConditionsFragment
        }
      }
    }
    transactions {
      id
      hash
      protocolVersion
      raw
      block {
        hash
        height
        protocolVersion
        timestamp
        author
        ledgerParameters
        parent {
          ...BlockFragment
        }
        transactions {
          ...TransactionFragment
        }
        systemParameters {
          ...SystemParametersFragment
        }
      }
      contractActions {
        address
        state
        zswapState
        transaction {
          ...TransactionFragment
        }
        unshieldedBalances {
          ...ContractBalanceFragment
        }
      }
      unshieldedCreatedOutputs {
        owner
        tokenType
        value
        intentHash
        outputIndex
        ctime
        initialNonce
        registeredForDustGeneration
        createdAtTransaction {
          ...TransactionFragment
        }
        spentAtTransaction {
          ...TransactionFragment
        }
      }
      unshieldedSpentOutputs {
        owner
        tokenType
        value
        intentHash
        outputIndex
        ctime
        initialNonce
        registeredForDustGeneration
        createdAtTransaction {
          ...TransactionFragment
        }
        spentAtTransaction {
          ...TransactionFragment
        }
      }
      zswapLedgerEvents {
        id
        raw
        maxId
        protocolVersion
      }
      dustLedgerEvents {
        id
        raw
        maxId
        protocolVersion
      }
    }
    systemParameters {
      dParameter {
        numPermissionedCandidates
        numRegisteredCandidates
      }
      termsAndConditions {
        hash
        url
      }
    }
  }
}
Variables
{"offset": BlockOffset}
Response
{
  "data": {
    "blocks": {
      "hash": HexEncoded,
      "height": 987,
      "protocolVersion": 123,
      "timestamp": 123,
      "author": HexEncoded,
      "ledgerParameters": HexEncoded,
      "parent": Block,
      "transactions": [Transaction],
      "systemParameters": SystemParameters
    }
  }
}

contractActions

Description

Subscribe to contract actions with the given address starting at the given offset or at the latest block if the offset is omitted.

Response

Returns a ContractAction!

Arguments
Name Description
address - HexEncoded!
offset - BlockOffset

Example

Query
subscription ContractActions(
  $address: HexEncoded!,
  $offset: BlockOffset
) {
  contractActions(
    address: $address,
    offset: $offset
  ) {
    address
    state
    zswapState
    transaction {
      id
      hash
      protocolVersion
      raw
      block {
        hash
        height
        protocolVersion
        timestamp
        author
        ledgerParameters
        parent {
          ...BlockFragment
        }
        transactions {
          ...TransactionFragment
        }
        systemParameters {
          ...SystemParametersFragment
        }
      }
      contractActions {
        address
        state
        zswapState
        transaction {
          ...TransactionFragment
        }
        unshieldedBalances {
          ...ContractBalanceFragment
        }
      }
      unshieldedCreatedOutputs {
        owner
        tokenType
        value
        intentHash
        outputIndex
        ctime
        initialNonce
        registeredForDustGeneration
        createdAtTransaction {
          ...TransactionFragment
        }
        spentAtTransaction {
          ...TransactionFragment
        }
      }
      unshieldedSpentOutputs {
        owner
        tokenType
        value
        intentHash
        outputIndex
        ctime
        initialNonce
        registeredForDustGeneration
        createdAtTransaction {
          ...TransactionFragment
        }
        spentAtTransaction {
          ...TransactionFragment
        }
      }
      zswapLedgerEvents {
        id
        raw
        maxId
        protocolVersion
      }
      dustLedgerEvents {
        id
        raw
        maxId
        protocolVersion
      }
    }
    unshieldedBalances {
      tokenType
      amount
    }
  }
}
Variables
{
  "address": HexEncoded,
  "offset": BlockOffset
}
Response
{
  "data": {
    "contractActions": {
      "address": HexEncoded,
      "state": HexEncoded,
      "zswapState": HexEncoded,
      "transaction": Transaction,
      "unshieldedBalances": [ContractBalance]
    }
  }
}

dustLedgerEvents

Description

Subscribe to dust ledger events starting at the given ID or at the very start if omitted.

Response

Returns a DustLedgerEvent!

Arguments
Name Description
id - Int

Example

Query
subscription DustLedgerEvents($id: Int) {
  dustLedgerEvents(id: $id) {
    id
    raw
    maxId
    protocolVersion
  }
}
Variables
{"id": 123}
Response
{
  "data": {
    "dustLedgerEvents": {
      "id": 987,
      "raw": HexEncoded,
      "maxId": 123,
      "protocolVersion": 987
    }
  }
}

shieldedTransactions

Description

Subscribe to shielded transaction events for the given session ID starting at the given index or at zero if omitted.

Response

Returns a ShieldedTransactionsEvent!

Arguments
Name Description
sessionId - HexEncoded!
index - Int

Example

Query
subscription ShieldedTransactions(
  $sessionId: HexEncoded!,
  $index: Int
) {
  shieldedTransactions(
    sessionId: $sessionId,
    index: $index
  ) {
    ... on RelevantTransaction {
      transaction {
        id
        hash
        protocolVersion
        raw
        transactionResult {
          ...TransactionResultFragment
        }
        identifiers
        merkleTreeRoot
        startIndex
        endIndex
        fees {
          ...TransactionFeesFragment
        }
        block {
          ...BlockFragment
        }
        contractActions {
          ...ContractActionFragment
        }
        unshieldedCreatedOutputs {
          ...UnshieldedUtxoFragment
        }
        unshieldedSpentOutputs {
          ...UnshieldedUtxoFragment
        }
        zswapLedgerEvents {
          ...ZswapLedgerEventFragment
        }
        dustLedgerEvents {
          ...DustLedgerEventFragment
        }
      }
      collapsedMerkleTree {
        startIndex
        endIndex
        update
        protocolVersion
      }
    }
    ... on ShieldedTransactionsProgress {
      highestEndIndex
      highestCheckedEndIndex
      highestRelevantEndIndex
    }
  }
}
Variables
{"sessionId": HexEncoded, "index": 123}
Response
{"data": {"shieldedTransactions": RelevantTransaction}}

unshieldedTransactions

Description

Subscribe unshielded transaction events for the given address and the given transaction ID or zero if omitted.

Response

Returns an UnshieldedTransactionsEvent!

Arguments
Name Description
address - UnshieldedAddress!
transactionId - Int

Example

Query
subscription UnshieldedTransactions(
  $address: UnshieldedAddress!,
  $transactionId: Int
) {
  unshieldedTransactions(
    address: $address,
    transactionId: $transactionId
  ) {
    ... on UnshieldedTransaction {
      transaction {
        id
        hash
        protocolVersion
        raw
        block {
          ...BlockFragment
        }
        contractActions {
          ...ContractActionFragment
        }
        unshieldedCreatedOutputs {
          ...UnshieldedUtxoFragment
        }
        unshieldedSpentOutputs {
          ...UnshieldedUtxoFragment
        }
        zswapLedgerEvents {
          ...ZswapLedgerEventFragment
        }
        dustLedgerEvents {
          ...DustLedgerEventFragment
        }
      }
      createdUtxos {
        owner
        tokenType
        value
        intentHash
        outputIndex
        ctime
        initialNonce
        registeredForDustGeneration
        createdAtTransaction {
          ...TransactionFragment
        }
        spentAtTransaction {
          ...TransactionFragment
        }
      }
      spentUtxos {
        owner
        tokenType
        value
        intentHash
        outputIndex
        ctime
        initialNonce
        registeredForDustGeneration
        createdAtTransaction {
          ...TransactionFragment
        }
        spentAtTransaction {
          ...TransactionFragment
        }
      }
    }
    ... on UnshieldedTransactionsProgress {
      highestTransactionId
    }
  }
}
Variables
{"address": UnshieldedAddress, "transactionId": 987}
Response
{
  "data": {
    "unshieldedTransactions": UnshieldedTransaction
  }
}

zswapLedgerEvents

Description

Subscribe to zswap ledger events starting at the given ID or at the very start if omitted.

Response

Returns a ZswapLedgerEvent!

Arguments
Name Description
id - Int

Example

Query
subscription ZswapLedgerEvents($id: Int) {
  zswapLedgerEvents(id: $id) {
    id
    raw
    maxId
    protocolVersion
  }
}
Variables
{"id": 987}
Response
{
  "data": {
    "zswapLedgerEvents": {
      "id": 123,
      "raw": HexEncoded,
      "maxId": 123,
      "protocolVersion": 987
    }
  }
}

Types

Block

Description

A block with its relevant data.

Fields
Field Name Description
hash - HexEncoded! The block hash.
height - Int! The block height.
protocolVersion - Int! The protocol version.
timestamp - Int! The UNIX timestamp.
author - HexEncoded The hex-encoded block author.
ledgerParameters - HexEncoded! The hex-encoded ledger parameters for this block.
parent - Block The parent of this block.
transactions - [Transaction!]! The transactions within this block.
systemParameters - SystemParameters! The system parameters (governance) at this block height.
Example
{
  "hash": HexEncoded,
  "height": 123,
  "protocolVersion": 123,
  "timestamp": 987,
  "author": HexEncoded,
  "ledgerParameters": HexEncoded,
  "parent": Block,
  "transactions": [Transaction],
  "systemParameters": SystemParameters
}

BlockOffset

Description

Either a block hash or a block height.

Fields
Input Field Description
hash - HexEncoded A hex-encoded block hash.
height - Int A block height.
Example
{"hash": HexEncoded, "height": 987}

Boolean

Description

The Boolean scalar type represents true or false.

CardanoRewardAddress

Example
CardanoRewardAddress

CollapsedMerkleTree

Fields
Field Name Description
startIndex - Int! The zswap state start index.
endIndex - Int! The zswap state end index.
update - HexEncoded! The hex-encoded value.
protocolVersion - Int! The protocol version.
Example
{
  "startIndex": 123,
  "endIndex": 987,
  "update": HexEncoded,
  "protocolVersion": 123
}

CommitteeMember

Description

Committee member for an epoch.

Fields
Field Name Description
epochNo - Int!
position - Int!
sidechainPubkeyHex - String!
expectedSlots - Int!
auraPubkeyHex - String
poolIdHex - String
spoSkHex - String
Example
{
  "epochNo": 123,
  "position": 987,
  "sidechainPubkeyHex": "xyz789",
  "expectedSlots": 987,
  "auraPubkeyHex": "xyz789",
  "poolIdHex": "xyz789",
  "spoSkHex": "xyz789"
}

ContractAction

Description

A contract action.

Fields
Field Name Description
address - HexEncoded!
state - HexEncoded!
zswapState - HexEncoded!
transaction - Transaction!
unshieldedBalances - [ContractBalance!]!
Possible Types
ContractAction Types

ContractCall

ContractDeploy

ContractUpdate

Example
{
  "address": HexEncoded,
  "state": HexEncoded,
  "zswapState": HexEncoded,
  "transaction": Transaction,
  "unshieldedBalances": [ContractBalance]
}

ContractActionOffset

Description

Either a block offset or a transaction offset.

Fields
Input Field Description
blockOffset - BlockOffset Either a block hash or a block height.
transactionOffset - TransactionOffset Either a transaction hash or a transaction identifier.
Example
{
  "blockOffset": BlockOffset,
  "transactionOffset": TransactionOffset
}

ContractBalance

Description

Represents a token balance held by a contract. This type is exposed through the GraphQL API to allow clients to query unshielded token balances for any contract action (Deploy, Call, Update).

Fields
Field Name Description
tokenType - HexEncoded! Hex-encoded token type identifier.
amount - String! Balance amount as string to support larger integer values (up to 16 bytes).
Example
{
  "tokenType": HexEncoded,
  "amount": "abc123"
}

ContractCall

Description

A contract call.

Fields
Field Name Description
address - HexEncoded! The hex-encoded serialized address.
state - HexEncoded! The hex-encoded serialized state.
zswapState - HexEncoded! The hex-encoded serialized contract-specific zswap state.
entryPoint - String! The entry point.
transaction - Transaction! Transaction for this contract call.
deploy - ContractDeploy! Contract deploy for this contract call.
unshieldedBalances - [ContractBalance!]! Unshielded token balances held by this contract.
Example
{
  "address": HexEncoded,
  "state": HexEncoded,
  "zswapState": HexEncoded,
  "entryPoint": "xyz789",
  "transaction": Transaction,
  "deploy": ContractDeploy,
  "unshieldedBalances": [ContractBalance]
}

ContractDeploy

Description

A contract deployment.

Fields
Field Name Description
address - HexEncoded! The hex-encoded serialized address.
state - HexEncoded! The hex-encoded serialized state.
zswapState - HexEncoded! The hex-encoded serialized contract-specific zswap state.
transaction - Transaction! Transaction for this contract deploy.
unshieldedBalances - [ContractBalance!]! Unshielded token balances held by this contract.
Example
{
  "address": HexEncoded,
  "state": HexEncoded,
  "zswapState": HexEncoded,
  "transaction": Transaction,
  "unshieldedBalances": [ContractBalance]
}

ContractUpdate

Description

A contract update.

Fields
Field Name Description
address - HexEncoded! The hex-encoded serialized address.
state - HexEncoded! The hex-encoded serialized state.
zswapState - HexEncoded! The hex-encoded serialized contract-specific zswap state.
transaction - Transaction! Transaction for this contract update.
unshieldedBalances - [ContractBalance!]! Unshielded token balances held by this contract after the update.
Example
{
  "address": HexEncoded,
  "state": HexEncoded,
  "zswapState": HexEncoded,
  "transaction": Transaction,
  "unshieldedBalances": [ContractBalance]
}

DParameter

Description

The D-parameter controlling validator committee composition.

Fields
Field Name Description
numPermissionedCandidates - Int! Number of permissioned candidates.
numRegisteredCandidates - Int! Number of registered candidates.
Example
{"numPermissionedCandidates": 987, "numRegisteredCandidates": 123}

DParameterChange

Description

D-parameter change record for history queries.

Fields
Field Name Description
blockHeight - Int! The block height where this parameter became effective.
blockHash - HexEncoded! The hex-encoded block hash where this parameter became effective.
timestamp - Int! The UNIX timestamp when this parameter became effective.
numPermissionedCandidates - Int! Number of permissioned candidates.
numRegisteredCandidates - Int! Number of registered candidates.
Example
{
  "blockHeight": 987,
  "blockHash": HexEncoded,
  "timestamp": 987,
  "numPermissionedCandidates": 123,
  "numRegisteredCandidates": 987
}

DustAddress

Example
DustAddress

DustGenerationDtimeUpdate

Fields
Field Name Description
id - Int! The ID of this dust ledger event.
raw - HexEncoded! The hex-encoded serialized event.
maxId - Int! The maximum ID of all dust ledger events.
protocolVersion - Int! The protocol version.
Example
{
  "id": 987,
  "raw": HexEncoded,
  "maxId": 123,
  "protocolVersion": 987
}

DustGenerationStatus

Description

DUST generation status for a specific Cardano reward address.

Fields
Field Name Description
cardanoRewardAddress - CardanoRewardAddress! The Bech32-encoded Cardano reward address (e.g., stake_test1... or stake1...).
dustAddress - DustAddress The Bech32m-encoded associated DUST address if registered.
registered - Boolean! Whether this reward address is registered.
nightBalance - String! NIGHT balance backing generation in STAR.
generationRate - String! DUST generation rate in SPECK per second.
maxCapacity - String! Maximum DUST capacity in SPECK.
currentCapacity - String! Current generated DUST capacity in SPECK.
utxoTxHash - HexEncoded Cardano UTXO transaction hash for update/unregister operations.
utxoOutputIndex - Int Cardano UTXO output index for update/unregister operations.
Example
{
  "cardanoRewardAddress": CardanoRewardAddress,
  "dustAddress": DustAddress,
  "registered": true,
  "nightBalance": "abc123",
  "generationRate": "abc123",
  "maxCapacity": "abc123",
  "currentCapacity": "xyz789",
  "utxoTxHash": HexEncoded,
  "utxoOutputIndex": 123
}

DustInitialUtxo

Fields
Field Name Description
id - Int! The ID of this dust ledger event.
raw - HexEncoded! The hex-encoded serialized event.
maxId - Int! The maximum ID of all dust ledger events.
protocolVersion - Int! The protocol version.
output - DustOutput! The dust output.
Example
{
  "id": 987,
  "raw": HexEncoded,
  "maxId": 123,
  "protocolVersion": 987,
  "output": DustOutput
}

DustLedgerEvent

Description

A dust related ledger event.

Fields
Field Name Description
id - Int!
raw - HexEncoded!
maxId - Int!
protocolVersion - Int!
Example
{
  "id": 123,
  "raw": HexEncoded,
  "maxId": 123,
  "protocolVersion": 987
}

DustOutput

Description

A dust output.

Fields
Field Name Description
nonce - HexEncoded! The hex-encoded 32-byte nonce.
Example
{"nonce": HexEncoded}

DustSpendProcessed

Fields
Field Name Description
id - Int! The ID of this dust ledger event.
raw - HexEncoded! The hex-encoded serialized event.
maxId - Int! The maximum ID of all dust ledger events.
protocolVersion - Int! The protocol version.
Example
{
  "id": 123,
  "raw": HexEncoded,
  "maxId": 987,
  "protocolVersion": 123
}

EpochInfo

Description

Current epoch information.

Fields
Field Name Description
epochNo - Int!
durationSeconds - Int!
elapsedSeconds - Int!
Example
{"epochNo": 987, "durationSeconds": 987, "elapsedSeconds": 123}

EpochPerf

Description

SPO performance for an epoch.

Fields
Field Name Description
epochNo - Int!
spoSkHex - String!
produced - Int!
expected - Int!
identityLabel - String
stakeSnapshot - String
poolIdHex - String
validatorClass - String
Example
{
  "epochNo": 123,
  "spoSkHex": "xyz789",
  "produced": 987,
  "expected": 123,
  "identityLabel": "abc123",
  "stakeSnapshot": "xyz789",
  "poolIdHex": "abc123",
  "validatorClass": "xyz789"
}

FirstValidEpoch

Description

First valid epoch for an SPO identity.

Fields
Field Name Description
idKey - String!
firstValidEpoch - Int!
Example
{"idKey": "abc123", "firstValidEpoch": 123}

Float

Description

The Float scalar type represents signed double-precision fractional values as specified by IEEE 754.

Example
123.45

HexEncoded

Example
HexEncoded

Int

Description

The Int scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.

Example
987

ParamChange

Fields
Field Name Description
id - Int! The ID of this dust ledger event.
raw - HexEncoded! The hex-encoded serialized event.
maxId - Int! The maximum ID of all dust ledger events.
protocolVersion - Int! The protocol version.
Example
{
  "id": 987,
  "raw": HexEncoded,
  "maxId": 123,
  "protocolVersion": 123
}

PoolMetadata

Description

Pool metadata from Cardano.

Fields
Field Name Description
poolIdHex - String!
hexId - String
name - String
ticker - String
homepageUrl - String
logoUrl - String
Example
{
  "poolIdHex": "abc123",
  "hexId": "xyz789",
  "name": "xyz789",
  "ticker": "abc123",
  "homepageUrl": "xyz789",
  "logoUrl": "abc123"
}

PresenceEvent

Description

Presence event for an SPO in an epoch.

Fields
Field Name Description
epochNo - Int!
idKey - String!
source - String!
status - String
Example
{
  "epochNo": 123,
  "idKey": "abc123",
  "source": "abc123",
  "status": "abc123"
}

RegisteredStat

Description

Registration statistics for an epoch.

Fields
Field Name Description
epochNo - Int!
federatedValidCount - Int!
federatedInvalidCount - Int!
registeredValidCount - Int!
registeredInvalidCount - Int!
dparam - Float
Example
{
  "epochNo": 123,
  "federatedValidCount": 987,
  "federatedInvalidCount": 987,
  "registeredValidCount": 123,
  "registeredInvalidCount": 987,
  "dparam": 123.45
}

RegisteredTotals

Description

Cumulative registration totals for an epoch.

Fields
Field Name Description
epochNo - Int!
totalRegistered - Int!
newlyRegistered - Int!
Example
{"epochNo": 987, "totalRegistered": 987, "newlyRegistered": 987}

RegularTransaction

Description

A regular Midnight transaction.

Fields
Field Name Description
id - Int! The transaction ID.
hash - HexEncoded! The hex-encoded transaction hash.
protocolVersion - Int! The protocol version.
raw - HexEncoded! The hex-encoded serialized transaction content.
transactionResult - TransactionResult! The result of applying this transaction to the ledger state.
identifiers - [HexEncoded!]! The hex-encoded serialized transaction identifiers.
merkleTreeRoot - HexEncoded! The hex-encoded serialized merkle-tree root.
startIndex - Int! The zswap state start index.
endIndex - Int! The zswap state end index.
fees - TransactionFees! Fee information for this transaction.
block - Block! The block for this transaction.
contractActions - [ContractAction!]! The contract actions for this transaction.
unshieldedCreatedOutputs - [UnshieldedUtxo!]! Unshielded UTXOs created by this transaction.
unshieldedSpentOutputs - [UnshieldedUtxo!]! Unshielded UTXOs spent (consumed) by this transaction.
zswapLedgerEvents - [ZswapLedgerEvent!]! Zswap ledger events of this transaction.
dustLedgerEvents - [DustLedgerEvent!]! Dust ledger events of this transaction.
Example
{
  "id": 123,
  "hash": HexEncoded,
  "protocolVersion": 987,
  "raw": HexEncoded,
  "transactionResult": TransactionResult,
  "identifiers": [HexEncoded],
  "merkleTreeRoot": HexEncoded,
  "startIndex": 987,
  "endIndex": 123,
  "fees": TransactionFees,
  "block": Block,
  "contractActions": [ContractAction],
  "unshieldedCreatedOutputs": [UnshieldedUtxo],
  "unshieldedSpentOutputs": [UnshieldedUtxo],
  "zswapLedgerEvents": [ZswapLedgerEvent],
  "dustLedgerEvents": [DustLedgerEvent]
}

RelevantTransaction

Description

A transaction relevant for the subscribing wallet and an optional collapsed merkle tree.

Fields
Field Name Description
transaction - RegularTransaction! A transaction relevant for the subscribing wallet.
collapsedMerkleTree - CollapsedMerkleTree An optional collapsed merkle tree.
Example
{
  "transaction": RegularTransaction,
  "collapsedMerkleTree": CollapsedMerkleTree
}

Segment

Description

One of many segments for a partially successful transaction result showing success for some segment.

Fields
Field Name Description
id - Int! Segment ID.
success - Boolean! Successful or not.
Example
{"id": 987, "success": false}

ShieldedTransactionsEvent

Description

An event of the shielded transactions subscription.

Example
RelevantTransaction

ShieldedTransactionsProgress

Description

Information about the shielded transactions indexing progress.

Fields
Field Name Description
highestEndIndex - Int! The highest zswap state end index (see endIndex of Transaction) of all transactions. It represents the known state of the blockchain. A value of zero (completely unlikely) means that no shielded transactions have been indexed yet.
highestCheckedEndIndex - Int! The highest zswap state end index (see endIndex of Transaction) of all transactions checked for relevance. Initially less than and eventually (when some wallet has been fully indexed) equal to highest_end_index. A value of zero (very unlikely) means that no wallet has subscribed before and indexing for the subscribing wallet has not yet started.
highestRelevantEndIndex - Int! The highest zswap state end index (see endIndex of Transaction) of all relevant transactions for the subscribing wallet. Usually less than highest_checked_end_index unless the latest checked transaction is relevant for the subscribing wallet. A value of zero means that no relevant transactions have been indexed for the subscribing wallet.
Example
{
  "highestEndIndex": 987,
  "highestCheckedEndIndex": 987,
  "highestRelevantEndIndex": 123
}

Spo

Description

SPO with optional metadata.

Fields
Field Name Description
poolIdHex - String!
validatorClass - String!
sidechainPubkeyHex - String!
auraPubkeyHex - String
name - String
ticker - String
homepageUrl - String
logoUrl - String
Example
{
  "poolIdHex": "xyz789",
  "validatorClass": "abc123",
  "sidechainPubkeyHex": "abc123",
  "auraPubkeyHex": "abc123",
  "name": "xyz789",
  "ticker": "abc123",
  "homepageUrl": "xyz789",
  "logoUrl": "abc123"
}

SpoComposite

Description

Composite SPO data (identity + metadata + performance).

Fields
Field Name Description
identity - SpoIdentity
metadata - PoolMetadata
performance - [EpochPerf!]!
Example
{
  "identity": SpoIdentity,
  "metadata": PoolMetadata,
  "performance": [EpochPerf]
}

SpoIdentity

Description

SPO identity information.

Fields
Field Name Description
poolIdHex - String!
mainchainPubkeyHex - String!
sidechainPubkeyHex - String!
auraPubkeyHex - String
validatorClass - String!
Example
{
  "poolIdHex": "xyz789",
  "mainchainPubkeyHex": "abc123",
  "sidechainPubkeyHex": "xyz789",
  "auraPubkeyHex": "abc123",
  "validatorClass": "abc123"
}

StakeShare

Description

Stake share information for an SPO.

Values are sourced from mainchain pool data (e.g., Blockfrost) and keyed by Cardano pool_id.

Fields
Field Name Description
poolIdHex - String! Cardano pool ID (56-character hex string).
name - String Pool name from metadata.
ticker - String Pool ticker from metadata.
homepageUrl - String Pool homepage URL from metadata.
logoUrl - String Pool logo URL from metadata.
liveStake - String Current live stake in lovelace.
activeStake - String Current active stake in lovelace.
liveDelegators - Int Number of live delegators.
liveSaturation - Float Saturation ratio (0.0 to 1.0+).
declaredPledge - String Declared pledge in lovelace.
livePledge - String Current live pledge in lovelace.
stakeShare - Float Stake share as a fraction of total stake.
Example
{
  "poolIdHex": "xyz789",
  "name": "abc123",
  "ticker": "xyz789",
  "homepageUrl": "abc123",
  "logoUrl": "xyz789",
  "liveStake": "abc123",
  "activeStake": "xyz789",
  "liveDelegators": 987,
  "liveSaturation": 987.65,
  "declaredPledge": "xyz789",
  "livePledge": "xyz789",
  "stakeShare": 987.65
}

String

Description

The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.

Example
"abc123"

SystemParameters

Description

System parameters at a specific block height.

Fields
Field Name Description
dParameter - DParameter! The D-parameter controlling validator committee composition.
termsAndConditions - TermsAndConditions The current Terms and Conditions, if any have been set.
Example
{
  "dParameter": DParameter,
  "termsAndConditions": TermsAndConditions
}

SystemTransaction

Description

A system Midnight transaction.

Fields
Field Name Description
id - Int! The transaction ID.
hash - HexEncoded! The hex-encoded transaction hash.
protocolVersion - Int! The protocol version.
raw - HexEncoded! The hex-encoded serialized transaction content.
block - Block! The block for this transaction.
contractActions - [ContractAction!]! The contract actions for this transaction.
unshieldedCreatedOutputs - [UnshieldedUtxo!]! Unshielded UTXOs created by this transaction.
unshieldedSpentOutputs - [UnshieldedUtxo!]! Unshielded UTXOs spent (consumed) by this transaction.
zswapLedgerEvents - [ZswapLedgerEvent!]! Zswap ledger events of this transaction.
dustLedgerEvents - [DustLedgerEvent!]! Dust ledger events of this transaction.
Example
{
  "id": 987,
  "hash": HexEncoded,
  "protocolVersion": 987,
  "raw": HexEncoded,
  "block": Block,
  "contractActions": [ContractAction],
  "unshieldedCreatedOutputs": [UnshieldedUtxo],
  "unshieldedSpentOutputs": [UnshieldedUtxo],
  "zswapLedgerEvents": [ZswapLedgerEvent],
  "dustLedgerEvents": [DustLedgerEvent]
}

TermsAndConditions

Description

Terms and Conditions agreement.

Fields
Field Name Description
hash - HexEncoded! The hex-encoded hash of the Terms and Conditions document.
url - String! The URL where the Terms and Conditions can be found.
Example
{
  "hash": HexEncoded,
  "url": "xyz789"
}

TermsAndConditionsChange

Description

Terms and Conditions change record for history queries.

Fields
Field Name Description
blockHeight - Int! The block height where this T&C version became effective.
blockHash - HexEncoded! The hex-encoded block hash where this T&C version became effective.
timestamp - Int! The UNIX timestamp when this T&C version became effective.
hash - HexEncoded! The hex-encoded hash of the Terms and Conditions document.
url - String! The URL where the Terms and Conditions can be found.
Example
{
  "blockHeight": 987,
  "blockHash": HexEncoded,
  "timestamp": 123,
  "hash": HexEncoded,
  "url": "abc123"
}

Transaction

Description

A Midnight transaction.

Fields
Field Name Description
id - Int!
hash - HexEncoded!
protocolVersion - Int!
raw - HexEncoded!
block - Block!
contractActions - [ContractAction!]!
unshieldedCreatedOutputs - [UnshieldedUtxo!]!
unshieldedSpentOutputs - [UnshieldedUtxo!]!
zswapLedgerEvents - [ZswapLedgerEvent!]!
dustLedgerEvents - [DustLedgerEvent!]!
Possible Types
Transaction Types

RegularTransaction

SystemTransaction

Example
{
  "id": 123,
  "hash": HexEncoded,
  "protocolVersion": 123,
  "raw": HexEncoded,
  "block": Block,
  "contractActions": [ContractAction],
  "unshieldedCreatedOutputs": [UnshieldedUtxo],
  "unshieldedSpentOutputs": [UnshieldedUtxo],
  "zswapLedgerEvents": [ZswapLedgerEvent],
  "dustLedgerEvents": [DustLedgerEvent]
}

TransactionFees

Description

Fees information for a transaction, including both paid and estimated fees.

Fields
Field Name Description
paidFees - String! The actual fees paid for this transaction in DUST.
estimatedFees - String! The estimated fees that was calculated for this transaction in DUST.
Example
{
  "paidFees": "xyz789",
  "estimatedFees": "abc123"
}

TransactionOffset

Description

Either a transaction hash or a transaction identifier.

Fields
Input Field Description
hash - HexEncoded A hex-encoded transaction hash.
identifier - HexEncoded A hex-encoded transaction identifier.
Example
{
  "hash": HexEncoded,
  "identifier": HexEncoded
}

TransactionResult

Description

The result of applying a transaction to the ledger state. In case of a partial success (status), there will be segments.

Fields
Field Name Description
status - TransactionResultStatus!
segments - [Segment!]
Example
{"status": "SUCCESS", "segments": [Segment]}

TransactionResultStatus

Description

The status of the transaction result: success, partial success or failure.

Values
Enum Value Description

SUCCESS

PARTIAL_SUCCESS

FAILURE

Example
"SUCCESS"

Unit

Example
Unit

UnshieldedAddress

Example
UnshieldedAddress

UnshieldedTransaction

Description

A transaction that created and/or spent UTXOs alongside these and other information.

Fields
Field Name Description
transaction - Transaction! The transaction that created and/or spent UTXOs.
createdUtxos - [UnshieldedUtxo!]! UTXOs created in the above transaction, possibly empty.
spentUtxos - [UnshieldedUtxo!]! UTXOs spent in the above transaction, possibly empty.
Example
{
  "transaction": Transaction,
  "createdUtxos": [UnshieldedUtxo],
  "spentUtxos": [UnshieldedUtxo]
}

UnshieldedTransactionsEvent

Description

An event of the unshielded transactions subscription.

Example
UnshieldedTransaction

UnshieldedTransactionsProgress

Description

Information about the unshielded indexing progress.

Fields
Field Name Description
highestTransactionId - Int! The highest transaction ID of all currently known transactions for a subscribed address.
Example
{"highestTransactionId": 123}

UnshieldedUtxo

Description

Represents an unshielded UTXO.

Fields
Field Name Description
owner - UnshieldedAddress! Owner Bech32m-encoded address.
tokenType - HexEncoded! Token hex-encoded serialized token type.
value - String! UTXO value (quantity) as a string to support u128.
intentHash - HexEncoded! The hex-encoded serialized intent hash.
outputIndex - Int! Index of this output within its creating transaction.
ctime - Int The creation time in seconds.
initialNonce - HexEncoded! The hex-encoded initial nonce for DUST generation tracking.
registeredForDustGeneration - Boolean! Whether this UTXO is registered for DUST generation.
createdAtTransaction - Transaction! Transaction that created this UTXO.
spentAtTransaction - Transaction Transaction that spent this UTXO.
Example
{
  "owner": UnshieldedAddress,
  "tokenType": HexEncoded,
  "value": "xyz789",
  "intentHash": HexEncoded,
  "outputIndex": 123,
  "ctime": 123,
  "initialNonce": HexEncoded,
  "registeredForDustGeneration": true,
  "createdAtTransaction": Transaction,
  "spentAtTransaction": Transaction
}

ViewingKey

Example
ViewingKey

ZswapLedgerEvent

Description

A zswap related ledger event.

Fields
Field Name Description
id - Int! The ID of this zswap ledger event.
raw - HexEncoded! The hex-encoded serialized event.
maxId - Int! The maximum ID of all zswap ledger events.
protocolVersion - Int! The protocol version.
Example
{
  "id": 123,
  "raw": HexEncoded,
  "maxId": 123,
  "protocolVersion": 123
}