Overview
Arcium provides two TypeScript libraries for interacting with Arcium and deployed MXEs (MPC eXecution Environments). Client library@arcium-hq/client:
- Handles secret sharing and encryption of inputs
- Submits encrypted transactions
- Manages callbacks for computation results
@arcium-hq/reader:
- Reads MXE data
- Views computations for a given MXE
Installation
Client library:API reference
For complete TypeScript SDK documentation, see the API reference.Reclaiming computation rent
Every queued computation allocates a Solana account that holds rent. After the computation lifecycle completes, you should reclaim that rent.After successful finalization
Once a computation reachesFinalized status (after the callback executes), use claimComputationRent to close the account and reclaim the rent:
Computations that remain in
Queued status expire after 180 slots (~72 seconds). Expired computations can be reclaimed using the reclaimExpiredComputationFee instruction, which also returns any fees from the fee pool. See the API reference for details.claimComputationRent only closes per-computation accounts. To close long-lived MXE or computation-definition accounts, see Account lifecycle and closing.Reading computation fees
The reader library exposes two getters for inspecting a computation’s fee, depending on whether its account is still open:getComputationFee returns { source: 'account', ... } with the live onchain fee, or null when the account has been closed. getComputationFeeFromQueueTx returns { source: 'queueTx', ... } with the raw queue-time inputs (not lamport amounts) and requires an archive RPC that retains the original transaction and its inner instructions. See the API reference for the full return shapes.Using the client
Prefer a more step-by-step approach? Get started with learning how to encrypt inputs for encrypted transactions.What’s next?
Encrypting inputs
Step-by-step guide to encrypting data for encrypted transactions.
Tracking callbacks
Await and process computation results.
Full API reference
Complete TypeScript SDK documentation.