# Libraries

All libraries have been built and tested against the Lethean testnet.

## lethean_web3 (TypeScript) — 10/10 tests passing

Server + browser library for interacting with the Lethean daemon and wallet RPCs. Includes the Companion extension API for in-browser wallet signing.

- `fetchDaemon(method, params)` — daemon RPC calls
- `fetchWallet(method, params)` — wallet RPC calls
- `getAssetsList()` — list chain assets
- `getBalances()` — wallet balances
- `validateTokensInput(amount)` — input validation
- `getAliasDetails(alias)` — alias lookup

**Status:** Built (web + server + shared), 2 bugs fixed (ESM resolution, empty asset list crash), 10/10 integration tests against testnet.

Source: `zano-upstream/zano_web3/`

## lethean-util (C++ Node.js addon) — Built and tested

Native Node.js addon for mining pools and backend integrations. Bridges the Lethean C++ cryptographic library to JavaScript.

- `convert_blob(buffer)` — block template conversion for mining
- `get_pow_hash(blob, seed, height)` — PoW hash computation
- `is_address_valid(buffer)` — validate iTHN addresses
- `address_decode(buffer)` — decode address to public keys
- `get_blob_from_block_template(buffer)` — construct block from template
- `get_id_hash(buffer)` — block ID computation
- `get_merged_mining_nonce_size()` — merged mining support

**Status:** Built against Lethean blockchain headers, tested with live `getblocktemplate` output from testnet daemon.

Source: `zano-upstream/zano-node-util/`

## zano-utils-js (TypeScript) — 34/34 tests passing

Low-level cryptographic utilities: Ed25519, stealth addresses, key derivation, transaction decoding, Base58, payment ID encryption.

**Status:** All 34 tests pass. Protocol constants (`ZANO_HDS_*`) intentionally preserved for daemon compatibility.

Source: `zano-upstream/zano-utils-js/`

## wallet-address-validator (JavaScript) — 73/73 tests passing

Validates Lethean addresses (iTHN prefix). Supports all 4 address types:
- `iTHN` — standard address (prefix `f7d507`)
- `iTHn` — integrated address (prefix `f7d537`)
- `iThn` — auditable integrated (prefix `f7e022`)
- `iThN` — auditable address (prefix `f7dff301`)

**Status:** All 73 tests pass including Lethean-specific test cases.

Source: `zano-upstream/wallet-address-validator/`

## Native Wallet Library (C++)

C++ library for iOS/Android wallet integration. JSON-based API for framework-agnostic mobile development.

Source: `zano-upstream/zano_native_lib/`

## Flutter Wallet Plugin (Dart)

Dart/Flutter plugin wrapping the native wallet library for mobile app development.

Source: `zano-upstream/zano_plugin/`
