Overview
Arcium provides three TypeScript SDKs for interacting with Arcium, deployed MXEs (MPC eXecution Environments), and the staking program. Client library@arcium-hq/client:
- Handles key exchange, encryption, and decryption
- Derives Arcium PDAs and packs circuit data
- Waits for computation finalization
@arcium-hq/reader:
- Reads MXE data
- Views computations for a given MXE
@arcium-hq/staking:
- Derives staking program-derived addresses (PDAs)
- Reads typed staking accounts and delegated positions
- Builds staking instructions for a wallet to sign and send
Installation
Client library:Read staking accounts
With an AnchorAnchorProvider, create a typed staking program client, then read a wallet’s primary stake account and delegated positions:
null when the account does not exist. Instruction builders return a TransactionInstruction for your wallet to sign and send.
API reference
For complete documentation for all three TypeScript SDKs, 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. 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.