open-index/open-npm huggingface dataset:
npm package: @midnight-ntwrk/compact-js
Description: Typescript-based execution environment for smart contracts compiled with the Compact language
Author: IOHK
Latest version: 2.5.0

# Compact.js

## Introduction

Compact.js provides a Typescript-based execution environment for smart contracts
compiled with the [Compact](https://docs.midnight.network/develop/reference/compact/) language.
When a Compact smart contract is compiled with `compactc`, part of the output includes:

1. A JavaScript file.
2. A TypeScript [declaration file](https://www.typescriptlang.org/docs/handbook/2/type-declarations.html).

The JavaScript file contains:

- The execution logic for each circuit in the source contract,
- Logic for constructing the contract’s initial state,
- Utilities for converting on-chain contract state into a JavaScript representation.

Compact.js uses this file at run time to execute the circuits. The circuit execution results are
then used by higher level tools and frameworks (such as Midnight.js) in order to create and submit
transactions to the Midnight blockchain. At compile time, the types and utilities of Compact.js use
the TypeScript declaration file and the definitions it contains, to map types that make working with
the contract and its circuits more convenient, and TypeScript idiomatic.

> [!NOTE]  
> The term _runtime_ is often used to describe the JavaScript executable for a contract. This is
> distinct from the package `@midnight-ntwrk/compact-runtime`, which provides the utilities that each
> of these JavaScript executables use.
npm package: @midnight-ntwrk/compact-js-node
Description: Platform specific types and utilities for working with the Compact language on a Node.js runtime
Author: IOHK
Latest version: 2.5.0

# Compact.js (Node.js Platform)

## Introduction

Provides implementations of Compact.js service types that are specific to the Node.js runtime.

## Services Provided

- `ZKFileConfiguration`. An implementation of `ZKConfiguration` that reads ZK assets from the file system.
npm package: @midnight-ntwrk/compact-runtime
Description: Compact Runtime
Author: IOG
Latest version: 0.15.0

# Compact runtime library

This API provides runtime primitives used by Compact's TypeScript output, both
for use by the compiler output directly, and to utilise it or reproduce its
behaviour. This API re-exports a number of items from
`@midnight-ntwrk/onchain-runtime-v2`, and wraps others in a more TypeScript-friendly
API. Key parts of the API are:

- {@link setNetworkId}, required to ensure the right network is being targeted
- {@link CircuitContext}, and {@link CircuitResults} part of the input and
  output definition of all circuits
- {@link WitnessContext}, part of the input definition of all circuits
- Built-in functions:
  - Hashing/commitment
    - {@link transientHash}
    - {@link transientCommit}
    - {@link persistentHash}
    - {@link persistentCommit}
    - {@link degradeToTransient}
  - Elliptic curve
    - {@link ecAdd}
    - {@link ecMul}
    - {@link ecMulGenerator}
    - {@link hashToCurve}
- {@link ContractState}, encapsulating the entirety of a smart contract's
  on-chain state
- {@link StateValue}, encoding data a contract maintains on-chain
- {@link QueryContext}, providing an annotated view into the contract state,
  against which on-chain VM programs can be run
- {@link CompactType}, providing a runtime representation of basic Compact
  datatypes
- Various TypeScript types matching same-named Compact types
npm package: @midnight-ntwrk/midnight-js
Description: Barrel package for Midnight.js core framework
Author: IOHK
Latest version: 4.0.4

# Midnight.js

Barrel package that provides a single entry point to the core components of Midnight.js. Import all core modules from one package instead of installing them individually.

## Installation

```bash
yarn add @midnight-ntwrk/midnight-js
```

## Quick Start

```typescript
import { contracts, networkId, types, utils } from '@midnight-ntwrk/midnight-js';

networkId.setNetworkId('testnet');

const deployed = await contracts.deployContract(providers, {
  compiledContract: myContract,
  privateStateId: 'my-state',
  initialPrivateState: { counter: 0n }
});
```

## Modules

| Module       | Package                                  | Description                                    |
| ------------ | ---------------------------------------- | ---------------------------------------------- |
| `contracts`  | `@midnight-ntwrk/midnight-js-contracts`  | Contract deployment and interaction utilities   |
| `networkId`  | `@midnight-ntwrk/midnight-js-network-id` | Network identifier management                  |
| `types`      | `@midnight-ntwrk/midnight-js-types`      | Shared types, interfaces, and provider contracts|
| `utils`      | `@midnight-ntwrk/midnight-js-utils`      | Hex encoding, address validation, and utilities |

## Sub-path Imports

Each module is also available as a sub-path import for tree-shaking:

```typescript
import { deployContract, findDeployedContract } from '@midnight-ntwrk/midnight-js/contracts';
import { setNetworkId, getNetworkId } from '@midnight-ntwrk/midnight-js/network-id';
import { type ProofProvider, type WalletProvider } from '@midnight-ntwrk/midnight-js/types';
import { toHex, fromHex } from '@midnight-ntwrk/midnight-js/utils';
```

## Exports

```typescript
// Namespace imports (all modules)
import { contracts, networkId, types, utils } from '@midnight-ntwrk/midnight-js';

// Sub-path imports (individual modules)
import { ... } from '@midnight-ntwrk/midnight-js/contracts';
import { ... } from '@midnight-ntwrk/midnight-js/network-id';
import { ... } from '@midnight-ntwrk/midnight-js/types';
import { ... } from '@midnight-ntwrk/midnight-js/utils';
```

## Resources

- [Midnight Network](https://midnight.network)
- [Developer Hub](https://midnight.network/developer-hub)

## Terms & License

By using this package, you agree to [Midnight's Terms and Conditions](https://midnight.network/static/terms.pdf) and [Privacy Policy](https://midnight.network/static/privacy-policy.pdf).

Licensed under [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0).
npm package: @midnight-ntwrk/midnight-js-fetch-zk-config-provider
Description: MidnightJS module for retrieving proving and verifying keys and ZK intermediate representation
Author: IOHK
Latest version: 4.0.4

# Fetch ZK Config Provider

ZK configuration provider that retrieves proving keys, verifier keys, and ZK intermediate representation over HTTP/HTTPS. Designed for browser environments.

## Installation

```bash
yarn add @midnight-ntwrk/midnight-js-fetch-zk-config-provider
```

## Quick Start

```typescript
import { FetchZkConfigProvider } from '@midnight-ntwrk/midnight-js-fetch-zk-config-provider';

const zkConfigProvider = new FetchZkConfigProvider('https://example.com/zk-artifacts');

const proverKey = await zkConfigProvider.getProverKey('myCircuit');
const verifierKey = await zkConfigProvider.getVerifierKey('myCircuit');
const zkir = await zkConfigProvider.getZKIR('myCircuit');
```

## Configuration

| Parameter   | Required | Description                                           |
| ----------- | -------- | ----------------------------------------------------- |
| `baseURL`   | ✓        | Base URL for ZK artifact server (http:// or https://) |
| `fetchFunc` |          | Custom fetch function (defaults to cross-fetch)       |

## API

### FetchZkConfigProvider

```typescript
class FetchZkConfigProvider<K extends string> extends ZKConfigProvider<K> {
  constructor(baseURL: string, fetchFunc?: typeof fetch);

  getProverKey(circuitId: K): Promise<ProverKey>;
  getVerifierKey(circuitId: K): Promise<VerifierKey>;
  getZKIR(circuitId: K): Promise<ZKIR>;
}
```

## Directory Structure

The provider expects the following URL structure on the server:

```
{baseURL}/
├── keys/
│   ├── {circuitId}.prover      # Prover key (binary)
│   └── {circuitId}.verifier    # Verifier key (binary)
└── zkir/
    └── {circuitId}.bzkir       # ZK intermediate representation (binary)
```

## Exports

```typescript
import { FetchZkConfigProvider } from '@midnight-ntwrk/midnight-js-fetch-zk-config-provider';
```

## Resources

- [Midnight Network](https://midnight.network)
- [Developer Hub](https://midnight.network/developer-hub)

## Terms & License

By using this package, you agree to [Midnight's Terms and Conditions](https://midnight.network/static/terms.pdf) and [Privacy Policy](https://midnight.network/static/privacy-policy.pdf).

Licensed under [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0).
npm package: @midnight-ntwrk/midnight-js-logger-provider
Description: MidnightJS module for configuring an application specific pino logger
Author: IOG
Latest version: 4.0.4

# Logger Provider

Configurable [pino](https://getpino.io/) logger wrapper for Midnight.js diagnostics and debugging.

## Installation

```bash
yarn add @midnight-ntwrk/midnight-js-logger-provider
```

## Quick Start

```typescript
import pino from 'pino';
import { LoggerProvider } from '@midnight-ntwrk/midnight-js-logger-provider';

const logger = new LoggerProvider(pino({ level: 'debug' }));

logger.debug('External API call', { endpoint: '/api/data' });
logger.trace('Internal diagnostic', { state: 'processing' });
```

## Log Levels

Midnight.js uses the following log levels:

| Level   | Usage                        |
| ------- | ---------------------------- |
| `trace` | Internal diagnostics         |
| `debug` | External API calls           |
| `info`  | General information          |
| `warn`  | Warning conditions           |
| `error` | Error conditions             |
| `fatal` | Critical failures            |

## API

### LoggerProvider

```typescript
class LoggerProvider {
  constructor(logger: Logger);

  info(...args: unknown[]): void;
  error(...args: unknown[]): void;
  warn(...args: unknown[]): void;
  debug(...args: unknown[]): void;
  trace(...args: unknown[]): void;
  fatal(...args: unknown[]): void;
  isLevelEnabled(level: LogLevel): boolean;
}
```

## Usage with Midnight Providers

```typescript
import pino from 'pino';
import { LoggerProvider } from '@midnight-ntwrk/midnight-js-logger-provider';

const loggerProvider = new LoggerProvider(
  pino({
    level: 'trace',
    transport: {
      target: 'pino-pretty'
    }
  })
);

// Use with Midnight providers
const providers = {
  loggerProvider,
  // ... other providers
};
```

## Exports

```typescript
import { LoggerProvider } from '@midnight-ntwrk/midnight-js-logger-provider';
```

## Resources

- [Midnight Network](https://midnight.network)
- [Developer Hub](https://midnight.network/developer-hub)
- [Pino Logger](https://getpino.io/)

## Terms & License

By using this package, you agree to [Midnight's Terms and Conditions](https://midnight.network/static/terms.pdf) and [Privacy Policy](https://midnight.network/static/privacy-policy.pdf).

Licensed under [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0).
npm package: @midnight-ntwrk/midnight-js-node-zk-config-provider
Description: MidnightJS module for reading proving and verifying keys and ZK intermediate representation
Author: IOG
Latest version: 4.0.4

# Node ZK Config Provider

ZK configuration provider that reads proving keys, verifier keys, and ZK intermediate representation from the local filesystem. Designed for Node.js environments.

## Installation

```bash
yarn add @midnight-ntwrk/midnight-js-node-zk-config-provider
```

## Quick Start

```typescript
import { NodeZkConfigProvider } from '@midnight-ntwrk/midnight-js-node-zk-config-provider';

const zkConfigProvider = new NodeZkConfigProvider('/path/to/zk-artifacts');

const proverKey = await zkConfigProvider.getProverKey('myCircuit');
const verifierKey = await zkConfigProvider.getVerifierKey('myCircuit');
const zkir = await zkConfigProvider.getZKIR('myCircuit');
```

## Configuration

| Parameter   | Required | Description                                |
| ----------- | -------- | ------------------------------------------ |
| `directory` | ✓        | Base directory path for ZK artifact files  |

## API

### NodeZkConfigProvider

```typescript
class NodeZkConfigProvider<K extends string> extends ZKConfigProvider<K> {
  constructor(directory: string);

  getProverKey(circuitId: K): Promise<ProverKey>;
  getVerifierKey(circuitId: K): Promise<VerifierKey>;
  getZKIR(circuitId: K): Promise<ZKIR>;
}
```

## Directory Structure

The provider expects the following directory structure:

```
{directory}/
├── keys/
│   ├── {circuitId}.prover      # Prover key (binary)
│   └── {circuitId}.verifier    # Verifier key (binary)
└── zkir/
    └── {circuitId}.bzkir       # ZK intermediate representation (binary)
```

## Exports

```typescript
import { NodeZkConfigProvider } from '@midnight-ntwrk/midnight-js-node-zk-config-provider';
```

## Resources

- [Midnight Network](https://midnight.network)
- [Developer Hub](https://midnight.network/developer-hub)

## Terms & License

By using this package, you agree to [Midnight's Terms and Conditions](https://midnight.network/static/terms.pdf) and [Privacy Policy](https://midnight.network/static/privacy-policy.pdf).

Licensed under [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0).
npm package: @midnight-ntwrk/midnight-js-utils
Description: Shared utilities for MidnightJS modules
Author: IOHK
Latest version: 4.0.4

# Utils

Shared utility functions for all Midnight.js modules.

## Installation

```bash
yarn add @midnight-ntwrk/midnight-js-utils
```

## Quick Start

```typescript
import {
  toHex,
  fromHex,
  assertDefined,
  assertIsContractAddress
} from '@midnight-ntwrk/midnight-js-utils';

// Convert bytes to hex
const hex = toHex(new Uint8Array([0xab, 0xcd])); // 'abcd'

// Convert hex to bytes
const bytes = fromHex('abcd');

// Assert value is defined
assertDefined(maybeValue, 'Value must be defined');

// Validate contract address
assertIsContractAddress(address);
```

## API

### Hex Utilities

```typescript
// Convert bytes to hex string
toHex(bytes: Uint8Array): string

// Convert hex string to bytes
fromHex(str: string): Buffer

// Check if string is valid hex
isHex(source: string, byteLen?: number): boolean

// Assert string is valid hex
assertIsHex(source: string, byteLen?: number): asserts source is string

// Parse hex string details
parseHex(source: string): ParsedHexString

type ParsedHexString = {
  hasPrefix: boolean;      // Has '0x' prefix
  byteChars: string;       // Valid hex byte characters
  incompleteChars: string; // Invalid or incomplete characters
}
```

### Bech32m Key Parsing

```typescript
// Parse coin public key (Bech32m or hex) to hex
parseCoinPublicKeyToHex(possibleBech32: string, zswapNetworkId: NetworkId): string

// Parse encryption public key (Bech32m or hex) to hex
parseEncPublicKeyToHex(possibleBech32: string, zswapNetworkId: NetworkId): string
```

### Assertion Utilities

```typescript
// Assert value is non-null/undefined
assertDefined<A>(
  value: A | null | undefined,
  message?: string
): asserts value is NonNullable<A>

// Assert value is null/undefined
assertUndefined<A>(
  value: A | null | undefined,
  message?: string
): asserts value is undefined | null
```

### Type Utilities

```typescript
// Assert valid contract address format (32 bytes hex, no prefix)
assertIsContractAddress(
  contractAddress: string
): asserts contractAddress is ContractAddress
```

### Date Utilities

```typescript
// Get Date one hour from now (for TTL)
ttlOneHour(): Date
```

## Exports

```typescript
import {
  // Hex utilities
  toHex,
  fromHex,
  isHex,
  assertIsHex,
  parseHex,
  type ParsedHexString,

  // Bech32m parsing
  parseCoinPublicKeyToHex,
  parseEncPublicKeyToHex,

  // Assertions
  assertDefined,
  assertUndefined,

  // Type utilities
  assertIsContractAddress,

  // Date utilities
  ttlOneHour
} from '@midnight-ntwrk/midnight-js-utils';
```

## Resources

- [Midnight Network](https://midnight.network)
- [Developer Hub](https://midnight.network/developer-hub)

## Terms & License

By using this package, you agree to [Midnight's Terms and Conditions](https://midnight.network/static/terms.pdf) and [Privacy Policy](https://midnight.network/static/privacy-policy.pdf).

Licensed under [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0).
npm package: @midnight-ntwrk/wallet
Description: Midnight Wallet SDK is an implementation of `@midnight-ntwrk/wallet-api` enables managing private keys, transactions and interacting with decentralized applications in the Midnight blockchain.
Author: IOHK
Latest version: 5.0.0

# Midnight Wallet SDK

Midnight Wallet SDK is an implementation of `@midnight-ntwrk/wallet-api` enables managing private keys, transactions and interacting with decentralized applications in the Midnight blockchain.


## Installing

The package is provided under the namespace `@midnight-ntwrk/wallet`. You can install it using any node package manager.

### Using Yarn
```bash
yarn add @midnight-ntwrk/wallet
```

### Using npm
```bash
npm install @midnight-ntwrk/wallet
```

### Using pnpm
```bash
pnpm add @midnight-ntwrk/wallet
```

## Documentation
See [https://docs.midnight.network/develop/guides/wallet-dev-guide](https://docs.midnight.network/develop/guides/wallet-dev-guide)

## API
See [https://docs.midnight.network/develop/reference/midnight-api/wallet-api/](https://docs.midnight.network/develop/reference/midnight-api/wallet-api/)
npm package: @midnight-ntwrk/wallet-api
Description: This API provides a comprehensive interface for wallet operations, defining the structure of the wallet state, the methods for interacting with it, and the types and variables used within. It is implemented by the [@midnight-ntwrk/wallet](https://www.npmj
Author: IOHK
Latest version: 5.0.0

# Midnight Wallet API

This API provides a comprehensive interface for wallet operations, defining the structure of the wallet state, the methods for interacting with it, and the types and variables used within. It is implemented by the [@midnight-ntwrk/wallet](https://www.npmjs.com/package/@midnight-ntwrk/wallet) package.

For detailed information, please visit the [API reference documentation](https://docs.midnight.network/develop/reference/midnight-api/wallet-api/).
npm package: @midnight-ntwrk/wallet-sdk-abstractions
Description: Domain-specific abstractions for the wallet SDK
Author: Midnight Foundation
Latest version: 2.0.0

# @midnight-ntwrk/wallet-sdk-abstractions

Domain-specific abstractions for the Midnight Wallet SDK.

## Installation

```bash
npm install @midnight-ntwrk/wallet-sdk-abstractions
```

## Overview

This package provides core types and interfaces used throughout the Midnight Wallet SDK. It defines the fundamental
abstractions for:

- Network identification
- Protocol state and versioning
- Wallet seeds and state management
- Transaction serialization

## Exports

### NetworkId

Network identifier types for distinguishing between different Midnight networks (e.g., mainnet, testnet).

### ProtocolState

Types representing the current state of the Midnight protocol.

### ProtocolVersion

Version information for protocol compatibility.

### WalletSeed

Abstractions for wallet seed management and derivation.

### WalletState

Types representing the internal state of a wallet instance.

### SerializedTransaction

Types for serialized transaction data that can be stored or transmitted.

### SerializedUnprovenTransaction

Types for unproven transaction serialization before ZK proofs are generated.

## License

Apache-2.0
npm package: @midnight-ntwrk/wallet-sdk-dust-wallet
Description: Manages dust (transaction fees) on the Midnight network.
Author: Midnight Foundation
Latest version: 3.0.0

# @midnight-ntwrk/wallet-sdk-dust-wallet

Manages dust (transaction fees) on the Midnight network.

## Installation

```bash
npm install @midnight-ntwrk/wallet-sdk-dust-wallet
```

## Overview

The Dust Wallet handles dust operations on the Midnight network. Dust is required to pay transaction fees. This package
provides:

- Dust coin management and tracking
- Balance synchronization with the network
- Transaction fee calculation
- Dust generation from Night UTXOs
- Fee balancing for transactions

## Usage

### Starting the Wallet

```typescript
import { DustWallet } from '@midnight-ntwrk/wallet-sdk-dust-wallet';

await dustWallet.start(dustSecretKey);
```

### Observing State

```typescript
dustWallet.state.subscribe((state) => {
  console.log('Progress:', state.state.progress);
  console.log('Balance:', state.state.balance);
  console.log('Dust Address:', state.dustAddress);
});

// Or wait for sync
const syncedState = await dustWallet.waitForSyncedState();
```

### Balancing Transaction Fees

```typescript
// Add fee balancing to a transaction
const feeBalancingTx = await dustWallet.balanceTransactions(dustSecretKey, [transactionToBalance], ttl);
```

### Calculating Fees

```typescript
// Calculate the fee for a transaction only (does not include the balancing transaction fee)
const fee = await dustWallet.calculateFee([transaction]);

// Estimate the total fee including the balancing transaction fee
// ttl and currentTime are optional (default: 1 hour from now, and current block timestamp)
const totalFee = await dustWallet.estimateFee(dustSecretKey, [transaction]);

// With explicit ttl and currentTime
const totalFeeWithOptions = await dustWallet.estimateFee(dustSecretKey, [transaction], ttl, currentTime);
```

### Dust Generation

Register Night UTXOs to generate dust:

```typescript
const dustGenerationTx = await dustWallet.createDustGenerationTransaction(
  previousState,
  ttl,
  nightUtxos,
  nightVerifyingKey,
  dustReceiverAddress,
);

// Add signature for dust registration
const signedTx = await dustWallet.addDustGenerationSignature(dustGenerationTx, signature);
```

## Exports

- `DustWallet` - Main wallet class
- `DustWalletState` - Wallet state type
- `DustCoreWallet` - Core wallet implementation
- `Keys` - Key management utilities
- `Simulator` - Dust simulation utilities
- `SyncService` - Synchronization service
- `Transacting` - Transaction utilities
- `CoinsAndBalances` - Coin and balance management

## V1 Builder

Use the V1 builder pattern for wallet construction:

```typescript
import { V1Builder, RunningV1Variant } from '@midnight-ntwrk/wallet-sdk-dust-wallet';

// Build a V1 dust wallet variant
```

## License

Apache-2.0
npm package: @midnight-ntwrk/wallet-sdk-hd
Description: This package provides support for Hierarchical Deterministic (HD) Wallet.
Author: Midnight Foundation
Latest version: 3.0.1

# Midnight SDK HD Wallet

This package provides support for Hierarchical Deterministic (HD) Wallet.

To allow deterministic derivation of keys for different features, Midnight follows algorithms and structure being a mix
of [BIP-32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki),
[BIP-44](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki) and
[CIP-1852](https://github.com/cardano-foundation/CIPs/blob/master/CIP-1852/README.md). Specifically, derivation follows
BIP-32, and following path for a key pair is used:

```
m / purpose' / coin_type' / account' / role / index
```

Where:

- `purpose` is integer `44` (`0x8000002c`) - despite extensions, Night part of the hierarchy follows BIP-44
- `coin_type` is integer `2400` (`0x80000960`)
- `account` follows BIP-44 recommendations
- `role` follows table below
- `index` follows BIP-44 recommendations

| Role name            | Value | Description                                             |
| -------------------- | ----- | ------------------------------------------------------- |
| Night External chain | 0     | Night is Midnight's main token of value, Follows BIP-44 |
| Night Internal chain | 1     | as above                                                |
| Dust                 | 2     | Dust is needed to pay fees on Midnight                  |
| Zswap                | 3     | Zswap is a sub-protocol for shielded native tokens      |
| Metadata             | 4     | Keys for signing metadata                               |

## How to derive the keys?

Below you can find an example on how to derive keys from a random seed:

```typescript
import { generateRandomSeed, HDWallet, Roles } from '@midnight-ntwrk/wallet-sdk-hd';

const seed = generateRandomSeed();
const generatedWallet = HDWallet.fromSeed(seed);

if (generatedWallet.type == 'seedOk') {
  const zswapKey = generatedWallet.hdWallet.selectAccount(0).selectRole(Roles.Zswap).deriveKeyAt(0);
  if (zswapKey.type === 'keyDerived') {
    console.log('success', zswapKey.key);
  } else {
    console.error('Error deriving key');
  }
} else {
  console.error('Error generating HDWallet');
}
```
npm package: @midnight-ntwrk/wallet-sdk-indexer-client
Description: Client for communicating with the Midnight indexer service.
Author: Midnight Foundation
Latest version: 1.2.0

# @midnight-ntwrk/wallet-sdk-indexer-client

Client for communicating with the Midnight indexer service.

## Installation

```bash
npm install @midnight-ntwrk/wallet-sdk-indexer-client
```

## Overview

This package provides a GraphQL-based client for interacting with the Midnight indexer service. The indexer aggregates
blockchain data and provides efficient access to:

- **Subscriptions** for real-time event streaming:
  - Shielded transactions (Zswap)
  - Unshielded transactions
  - Zswap events
  - Dust ledger events

- **Queries** for fetching blockchain data:
  - Block information (height, hash, timestamp)
  - Ledger parameters (including cost model)
  - Connection management

## Usage

### Subscriptions

Subscribe to real-time events from the indexer:

```typescript
import {
  ShieldedTransactions,
  UnshieldedTransactions,
  ZswapEvents,
  DustLedgerEvents,
} from '@midnight-ntwrk/wallet-sdk-indexer-client';

// Subscribe to shielded transaction events
// Subscribe to unshielded transaction events
// Subscribe to Zswap events
// Subscribe to dust ledger events
```

### Queries

Query blockchain data:

```typescript
import { BlockHash } from '@midnight-ntwrk/wallet-sdk-indexer-client';

// Query block information including:
// - Block height
// - Block hash
// - Ledger parameters (cost model, etc.)
// - Timestamp
```

## Exports

### Default Export

- GraphQL queries: `Connect`, `Disconnect`, `BlockHash`
- GraphQL subscriptions: `ShieldedTransactions`, `UnshieldedTransactions`, `ZswapEvents`, `DustLedgerEvents`
- Generated GraphQL types

### Effect Submodule (`/effect`)

Effect.ts-based implementation for functional programming patterns:

```typescript
import {
  Query,
  Subscription,
  QueryClient,
  SubscriptionClient,
  HttpQueryClient,
  WsSubscriptionClient,
} from '@midnight-ntwrk/wallet-sdk-indexer-client/effect';
```

## License

Apache-2.0
npm package: @midnight-ntwrk/wallet-sdk-node-client
Description: Client for communicating with the Midnight blockchain node.
Author: Midnight Foundation
Latest version: 1.1.0

# @midnight-ntwrk/wallet-sdk-node-client

Client for communicating with the Midnight blockchain node.

## Installation

```bash
npm install @midnight-ntwrk/wallet-sdk-node-client
```

## Overview

This package provides a client for interacting with the Midnight blockchain node using Polkadot.js APIs. It handles:

- RPC communication with the node
- Transaction submission and tracking
- Blockchain state queries
- Type-safe interactions via generated types

## Usage

### Basic Usage

```typescript
import { PolkadotNodeClient, makeConfig } from '@midnight-ntwrk/wallet-sdk-node-client';

// Initialize the client
const config = makeConfig({ endpoint: 'ws://localhost:9944' });
const client = await PolkadotNodeClient.init(config);

// Submit a transaction and wait for finalization
const result = await client.sendMidnightTransactionAndWait(serializedTransaction, 'Finalized');

// Clean up
await client.close();
```

### Tracking Submission Events

```typescript
// Get an observable of submission events
const events$ = client.sendMidnightTransaction(serializedTransaction);

events$.subscribe({
  next: (event) => {
    switch (event._tag) {
      case 'Submitted':
        console.log('Transaction submitted');
        break;
      case 'InBlock':
        console.log('Transaction in block:', event.blockHash);
        break;
      case 'Finalized':
        console.log('Transaction finalized');
        break;
    }
  },
});
```

## Exports

### Default Export

- `PolkadotNodeClient` - Main client class for node communication
- `Config` - Configuration type
- `makeConfig` - Configuration factory function
- `DEFAULT_CONFIG` - Default configuration values

### Effect Submodule (`/effect`)

Effect.ts-based implementation for functional programming patterns:

```typescript
import { NodeClient, PolkadotNodeClient } from '@midnight-ntwrk/wallet-sdk-node-client/effect';
```

### Testing Submodule (`/testing`)

Testing utilities and mocks:

```typescript
import { ... } from '@midnight-ntwrk/wallet-sdk-node-client/testing';
```

## License

Apache-2.0
npm package: @midnight-ntwrk/wallet-sdk-prover-client
Description: Client for interacting with the Midnight ZK proof generation service.
Author: Midnight Foundation
Latest version: 1.2.0

# @midnight-ntwrk/wallet-sdk-prover-client

Client for interacting with the Midnight ZK proof generation service.

## Installation

```bash
npm install @midnight-ntwrk/wallet-sdk-prover-client
```

## Overview

This package provides a client for submitting transactions to a Proof Server that generates zero-knowledge proofs. It is
used to finalize shielded transactions by converting unproven transactions into proven ones.

## Usage

### Basic Usage

```typescript
import { HttpProverClient } from '@midnight-ntwrk/wallet-sdk-prover-client';

// Initialize the client with the Proof Server URL
const proverClient = new HttpProverClient({
  serverUrl: 'http://localhost:6300',
});

// Prove an unproven transaction
const provenTransaction = await proverClient.proveTransaction(unprovenTransaction);
```

### With Custom Cost Model

```typescript
const provenTransaction = await proverClient.proveTransaction(unprovenTransaction, customCostModel);
```

## API

### HttpProverClient

```typescript
class HttpProverClient {
  constructor(config: { serverUrl: string });

  proveTransaction<S extends Signaturish, B extends Bindingish>(
    transaction: Transaction<S, PreProof, B>,
    costModel?: CostModel,
  ): Promise<Transaction<S, Proof, B>>;
}
```

## Exports

### Default Export

- `HttpProverClient` - HTTP client for the Proof Server

### Effect Submodule (`/effect`)

Effect.ts-based implementation:

```typescript
import { ProverClient, HttpProverClient } from '@midnight-ntwrk/wallet-sdk-prover-client/effect';
```

## Error Handling

The client may throw the following errors:

- `ClientError` - Issues with the provided transaction or connection problems
- `ServerError` - Internal server errors or connection failures
- `InvalidProtocolSchemeError` - Invalid URL scheme in configuration

## License

Apache-2.0
npm package: @midnight-ntwrk/wallet-sdk-runtime
Description: Runtime for the wallet variants
Author: Midnight Foundation
Latest version: 1.0.2

# @midnight-ntwrk/wallet-sdk-runtime

Runtime infrastructure for Midnight wallet variants.

## Installation

```bash
npm install @midnight-ntwrk/wallet-sdk-runtime
```

## Overview

This package provides the shared runtime functionality used across different wallet implementations in the Midnight
Wallet SDK. It includes:

- Wallet builder patterns for constructing wallet instances
- Runtime abstractions for wallet lifecycle management
- Common runtime utilities shared by wallet variants

## Exports

### Default Export

- `WalletBuilder` - Builder pattern for constructing wallet instances
- `Runtime` - Runtime utilities namespace

### Abstractions Submodule (`/abstractions`)

Runtime abstractions for extending wallet functionality:

```typescript
import { ... } from '@midnight-ntwrk/wallet-sdk-runtime/abstractions';
```

## License

Apache-2.0
npm package: @midnight-ntwrk/wallet-sdk-utilities
Description: Domain-agnostic utilities for the wallet SDK - common operations and types
Author: Midnight Foundation
Latest version: 1.1.0

# @midnight-ntwrk/wallet-sdk-utilities

Domain-agnostic utilities for the Midnight Wallet SDK.

## Installation

```bash
npm install @midnight-ntwrk/wallet-sdk-utilities
```

## Overview

This package provides common utility functions and types used throughout the Midnight Wallet SDK. It includes:

- Array operations
- Blob/binary data operations
- Date utilities
- Either/Result type operations
- Fluent API helpers
- Heterogeneous list types
- Ledger operations
- Observable utilities
- Polymorphic functions
- Record operations

## Exports

### Default Export

```typescript
import {
  ArrayOps, // Array manipulation utilities
  BlobOps, // Binary data operations
  DateOps, // Date handling utilities
  EitherOps, // Either/Result type helpers
  Fluent, // Fluent API patterns
  HList, // Heterogeneous list types
  LedgerOps, // Ledger-specific operations
  ObservableOps, // RxJS Observable utilities
  Poly, // Polymorphic function helpers
  RecordOps, // Object/Record utilities
} from '@midnight-ntwrk/wallet-sdk-utilities';
```

### Networking Submodule (`/networking`)

Network-related utilities:

```typescript
import { ... } from '@midnight-ntwrk/wallet-sdk-utilities/networking';
```

### Types Submodule (`/types`)

Common type definitions:

```typescript
import { ... } from '@midnight-ntwrk/wallet-sdk-utilities/types';
```

### Testing Submodule (`/testing`)

Testing utilities and helpers:

```typescript
import { ... } from '@midnight-ntwrk/wallet-sdk-utilities/testing';
```

## Usage Examples

### Observable Operations

```typescript
import { ObservableOps } from '@midnight-ntwrk/wallet-sdk-utilities';

// Convert Effect streams to RxJS Observables
const observable = ObservableOps.fromStream(effectStream);
```

### Array Operations

```typescript
import { ArrayOps } from '@midnight-ntwrk/wallet-sdk-utilities';

// Various array manipulation utilities
```

## License

Apache-2.0