> ## Documentation Index
> Fetch the complete documentation index at: https://fhenix-ci-version-drift-check.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# SDK Reference

> Complete API reference for @cofhe/sdk

<Info>
  This page is under construction. A full API reference documenting all functions, parameters, and return types will be added here.
</Info>

## Entrypoints

| Entrypoint            | Contents                                                                                             |
| --------------------- | ---------------------------------------------------------------------------------------------------- |
| `@cofhe/sdk`          | Core types: `Encryptable`, `FheTypes`, `EncryptStep`, `CofheError`, `CofheErrorCode`, `isCofheError` |
| `@cofhe/sdk/web`      | `createCofheConfig`, `createCofheClient` (browser defaults)                                          |
| `@cofhe/sdk/node`     | `createCofheConfig`, `createCofheClient` (Node.js defaults)                                          |
| `@cofhe/sdk/acps`     | `ACPUtils`, `setACP`, `setActiveACPHash`, `getACP`, `getActiveACPHash`                               |
| `@cofhe/sdk/adapters` | `Ethers5Adapter`, `Ethers6Adapter`, `WagmiAdapter`, `HardhatSignerAdapter`                           |
| `@cofhe/sdk/chains`   | `chains`, `getChainById`, `getChainByName`, `hardhat`                                                |

## Core types

### `Encryptable`

Factory for creating encryptable input items.

| Method                            | Input type         | Solidity param     |
| --------------------------------- | ------------------ | ------------------ |
| `Encryptable.bool(value)`         | `boolean`          | `externalEbool`    |
| `Encryptable.uint8(value)`        | `bigint \| string` | `externalEuint8`   |
| `Encryptable.uint16(value)`       | `bigint \| string` | `externalEuint16`  |
| `Encryptable.uint32(value)`       | `bigint \| string` | `externalEuint32`  |
| `Encryptable.uint64(value)`       | `bigint \| string` | `externalEuint64`  |
| `Encryptable.uint128(value)`      | `bigint \| string` | `externalEuint128` |
| `Encryptable.address(value)`      | `bigint \| string` | `externalEaddress` |
| `Encryptable.create(type, value)` | varies             | varies             |

### `FheTypes`

Enum of supported FHE types used with `decryptForView`.

| Value              | JS return type                 |
| ------------------ | ------------------------------ |
| `FheTypes.Bool`    | `boolean`                      |
| `FheTypes.Uint8`   | `bigint`                       |
| `FheTypes.Uint16`  | `bigint`                       |
| `FheTypes.Uint32`  | `bigint`                       |
| `FheTypes.Uint64`  | `bigint`                       |
| `FheTypes.Uint128` | `bigint`                       |
| `FheTypes.Uint160` | `string` (checksummed address) |

### The `encryptInputs` result

`execute()` returns one ciphertext handle per input, in order, followed by a single signature covering the whole batch:

```typescript theme={null}
type EncryptInputsResult = readonly `0x${string}`[];
// [ ...hashes, signature ]  -> inputs.length + 1 elements
```

The per-item `EncryptedItemInput` struct and its typed variants were removed in `0.7`, along with `asHashPlusProof()`.

### `EncryptStep`

Enum values fired during the encryption pipeline:

| Value                   | Description                  |
| ----------------------- | ---------------------------- |
| `EncryptStep.InitTfhe`  | Initialize TFHE WASM module  |
| `EncryptStep.FetchKeys` | Fetch FHE public key and CRS |
| `EncryptStep.Pack`      | Pack plaintext values        |
| `EncryptStep.Prove`     | Generate ZK proof            |
| `EncryptStep.Verify`    | Submit to CoFHE verifier     |
