Skip to main content
CypherClient is the SDK entrypoint. Construction is cheap and synchronous - no RPC calls until you call a method.
TypeScript

Constructor options

Connection
required
A @solana/web3.js Connection pointed at your target cluster. Pin @solana/web3.js to ^1.95.4 - the SDK is not compatible with v2 or @solana/kit.
Wallet
required
An Anchor-compatible wallet. Use keypairToWallet(keypair) for scripts, or pass a browser wallet adapter directly (they already implement the Wallet interface). Use readonlyWallet(pubkey) when the user is not connected.
'devnet' | 'mainnet' | 'localnet' | ClusterConfig
Cluster preset for Arcium-specific configuration. If omitted, the SDK infers from the connection’s RPC URL. Pass a full ClusterConfig to override the RPC, Arcium cluster offset, or expected mint.
Commitment
Commitment used by the underlying Anchor provider. Defaults to "confirmed".
PublicKey
Override the program ID. Only needed for local redeployments with a fresh keypair. Defaults to the ID from the synced IDL.
PublicKey
The SPL token program owning the accepted mint. Defaults to auto-detection on the first globalState.fetch(). Pass TOKEN_2022_PROGRAM_ID explicitly to skip the detection RPC call.
ConfirmOptions
Extra options forwarded to the Anchor provider (e.g., skipPreflight).
Partial<BatchOptions>
Tunables for the SDK’s bulk RPC reads — chunking, concurrency, and retry policy. Defaults are conservative enough for free-tier RPCs; bump concurrency on paid plans (Helius, Triton) to speed up large list views.
TypeScript
Available since v0.8.8.

Namespaces

CypherClient exposes high-level namespaces as read-only properties.
client
actions
placeBet(inputs)
createMarket(inputs)
createMarketMulti(inputs)
cancelMarket(inputs)
withdrawCreatorFunds(inputs)
resolveMarket(inputs)
claimPayout(inputs)
claimRefund(inputs)
flagResolution(inputs)
finalizeResolution(inputs)
adminOverrideResolution(inputs)

client.actions

High-level action helpers. Each orchestrates a full flow: validate → encrypt (if needed) → build instructions → send transaction → await Arcium callback → refetch.

client.markets

Account fetch helpers for MarketAccount.

client.positions

Account fetch helpers for EncryptedPositionAccount.

client.globalState

Pass { refresh: true } to bypass the cache: client.globalState.fetch({ refresh: true }).

client.lpPositions

client.marketQuestions

client.events


Wallet helpers

keypairToWallet

Wraps a Keypair as an Anchor-compatible Wallet. Use this for Node scripts, tests, and CLIs.
TypeScript

readonlyWallet

Creates a wallet that can sign nothing - only fetch operations work. Calling signTransaction or signAllTransactions throws a ReadonlyWalletError. Use it before the user connects their browser wallet.
TypeScript
Detect the read-only case in a mutation handler to show a “connect wallet” prompt instead of leaking the SDK detail:
TypeScript
See Errors → ReadonlyWalletError for the full type.