# @midnightntwrk/wallet-sdk-node-client

> Client for communicating with the Midnight blockchain node.

Latest version **1.1.3** (published 2026-06-19) · Apache-2.0 license · 1.7K weekly downloads

## Install

```sh
npm install @midnightntwrk/wallet-sdk-node-client
pnpm add @midnightntwrk/wallet-sdk-node-client
yarn add @midnightntwrk/wallet-sdk-node-client
bun add @midnightntwrk/wallet-sdk-node-client
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; high maintenance score; high quality score.

## Facts

| | |
|---|---|
| Version | 1.1.3 |
| Published | 2026-06-19 |
| First published | 2026-06-19 |
| Weekly downloads | 1.7K |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 8 |
| Unpacked size | 49.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 15 |
| Author | Midnight Foundation |
| Maintainers | ntwrk-bot |

## Links

- npm: https://www.npmjs.com/package/@midnightntwrk/wallet-sdk-node-client
- Repository: https://github.com/midnightntwrk/midnight-wallet
- Homepage: https://github.com/midnightntwrk/midnight-wallet#readme
- Issues: https://github.com/midnightntwrk/midnight-wallet/issues
- npm.io page: https://npm.io/package/@midnightntwrk/wallet-sdk-node-client

## Dependencies (8)

- [bn.js](https://npm.io/package/bn.js.md) ^5.2.3
- [effect](https://npm.io/package/effect.md) ^3.19.19
- [@types/bn.js](https://npm.io/package/@types/bn.js.md) ^5.2.0
- [@polkadot/api](https://npm.io/package/@polkadot/api.md) ^16.5.4
- [@polkadot/util](https://npm.io/package/@polkadot/util.md) ^14.0.1
- [@polkadot/types](https://npm.io/package/@polkadot/types.md) ^16.5.4
- [@midnightntwrk/wallet-sdk-utilities](https://npm.io/package/@midnightntwrk/wallet-sdk-utilities.md) ^1.2.0
- [@midnightntwrk/wallet-sdk-abstractions](https://npm.io/package/@midnightntwrk/wallet-sdk-abstractions.md) ^2.1.0

## Recent versions

- 1.1.3 (latest) — 2026-06-19
- 2.0.0-canary.20261013150531-6289ea3 (canary) — 2026-10-13
- 2.0.0-canary.20261009161442-8f95733 (canary-v1) — 2026-10-09
- 2.0.0-rc.1 (rc) — 2026-10-07
- 2.0.0-canary.20261007114939-7ee351c (canary-v2) — 2026-10-07
- 2.0.0-beta.4 (beta) — 2026-09-24
- 2.0.0-canary.20261013132526-8a87477 — 2026-10-13
- 2.0.0-canary.20261012130426-60e35b6 — 2026-10-12
- 2.0.0-canary.20261006161905-56542fa — 2026-10-06
- 2.0.0-canary.20261006082857-3c6134f — 2026-10-06
- 2.0.0-canary.20261005170924-1c8b4e7 — 2026-10-05
- 1.1.4-canary.20260930095107-aae483d — 2026-09-30
- 1.1.4-canary.20260929170316-1583a02 — 2026-09-29
- 2.0.0-canary.20260928141213-d0f38b3 — 2026-09-28
- 2.0.0-rc.0 — 2026-09-24
- … 83 more at https://npm.io/package/@midnightntwrk/wallet-sdk-node-client/versions

## README

# @midnightntwrk/wallet-sdk-node-client

Client for communicating with the Midnight blockchain node.

## Installation

```bash
npm install @midnightntwrk/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 '@midnightntwrk/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 '@midnightntwrk/wallet-sdk-node-client/effect';
```

### Testing Submodule (`/testing`)

Testing utilities and mocks:

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

## License

Apache-2.0

---
_Source: https://npm.io/package/@midnightntwrk/wallet-sdk-node-client · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
