# @umbra-privacy/umbra-codama

Auto-generated TypeScript client for the Umbra Solana program. Provides type-safe account decoders, instruction builders, error types, and discriminator constants generated from the program IDL using [Codama](https://github.com/codama-idl/codama).

## Installation

```bash
pnpm add @umbra-privacy/umbra-codama
```

## Overview

This package is consumed internally by `@umbra-privacy/sdk`. You typically don't need to install it directly unless you're building low-level tooling that interacts with the Umbra program accounts and instructions without the SDK's service layer.

## What's Included

- **Accounts** — Type-safe decoders for all Umbra program accounts (`ArciumEncryptedUserAccount`, `ArciumEncryptedTokenAccount`, `PoolConfiguration`, `MixerTree`, `TreapHeader`, etc.)
- **Instructions** — Builders for every Umbra program instruction with validated input types
- **Types** — Solana-native types generated from the IDL (enums, structs, option types)
- **Errors** — Program error codes and human-readable messages
- **Program metadata** — Program ID constant and discriminators

## Usage

```typescript
import {
  fetchArciumEncryptedUserAccount,
  getInitializeUserAccountInstruction,
  UMBRA_PROGRAM_ADDRESS,
} from "@umbra-privacy/umbra-codama";
```

## Regeneration

This package is auto-generated from the Umbra program IDL. Do not edit files directly. To regenerate after an IDL change:

```bash
pnpm run codama:js   # from monorepo root
```

## Dependencies

- `@solana/kit` ^6.0.1
- `@solana-program/system` ^0.11.0
- `@solana-program/token-2022` ^0.9.0

## License

MIT
