Arcium LogoArcium TS SDK Docs

Reading & Monitoring On-Chain State

Use the Arcium Reader SDK to query accounts, subscribe to computation events, and read the mempool fee market

Overview

The @arcium-hq/reader SDK is a read-only library for querying and monitoring Arcium network state on Solana. Use it to build indexers, dashboards, monitors, and fee-aware clients — anything that observes the network rather than submitting confidential computations.

npm install @arcium-hq/reader

Subscribe to Computation Events

Track a computation through its lifecycle (init → queue → callback → finalize) by subscribing to your MXE program's logs:

import { ,  } from "@arcium-hq/reader";

const  = await (
  connection,
  programId,
  (, ) => {
    if ( === "FinalizeComputationEvent") {
      .("Finalized:", .computationOffset.toString());
    }
  }
);

// When done, remove the subscription:
await (connection, );

The callback fires for InitComputationEvent, QueueComputationEvent, CallbackComputationEvent, and FinalizeComputationEvent.

Read Network State

Fetch parsed account data for MXEs, clusters, and nodes — and discover them on-chain:

import {
  ,
  ,
  ,
  ,
  ,
} from "@arcium-hq/reader";

const  = (provider);

// Discover every MXE deployed on the network
const  = await (provider.connection);

// Read a single MXE's metadata (cluster, comp-defs, migration state)
const  = await (, [0]);
.("Cluster offset:", .cluster);
.("Computation definitions:", .computationDefinitions.length);

// Read the cluster the MXE runs on
const  = await (
  ,
  (.cluster)
);

Read the Mempool Fee Market

Inspect priority-fee statistics across queued computations — useful for fee-aware clients and capacity monitoring:

import { ,  } from "@arcium-hq/reader";

const  = await (
  arciumProgram,
  (clusterOffset)
);

.({
  : .mean.toString(),
  : .median.toString(),
  : .min.toString(),
  : .max.toString(),
  : .count,
});

What's Next

On this page