# Wallet SDK v3.0.0 release notes

> For the complete documentation index, see [llms.txt](https://docs.midnight.network/llms.txt)

* **Version**: v3.0.0
* **Date**: 20 March, 2026
* **Environment**: Mainnet, Preprod, Preview

***

## High-level summary[​](#high-level-summary "Direct link to High-level summary")

This release focuses on accurate fee estimation and developer ergonomics. Fee calculation is now split into a context-free `calculateFee` and a wallet-aware `estimateFee` that accounts for available coins and balancing transaction cost. The SDK is updated to ledger v8. It also introduces `fetchTermsAndConditions` for retrieving network Terms and Conditions before initialization, and a promise-based `QueryRunner` for developers not using Effect.

***

## Audience[​](#audience "Direct link to Audience")

This release is relevant for developers who:

* Build wallets for the Midnight Network
* Integrate Midnight token transfers into their DApps
* Need to manage shielded (private) and unshielded token balances
* Implement atomic swaps between parties

***

## What changed (Summary of updates)[​](#what-changed-summary-of-updates "Direct link to What changed (Summary of updates)")

This release refines fee behavior and improves developer workflows while aligning the SDK with ledger v8. The updates below summarize API additions and security-focused handling changes across wallet implementations.

* Fee calculation now uses two APIs: `calculateFee` for a transaction in isolation, and `estimateFee` for the fee the current wallet would pay including balancing costs.
* Updated to ledger v8 across the SDK.
* New `WalletFacade.fetchTermsAndConditions()` static method for retrieving network Terms and Conditions.
* New `QueryRunner.runPromise()` utility for executing GraphQL queries as plain Promises.
* `SecretKeysResource` in shielded and DUST wallets now clears keys from memory after use.
* Shielded wallet now clears pending coins on transaction failure.
* Improved error messages for invalid transaction submission and balancing failures.

***

## New features[​](#new-features "Direct link to New features")

Below is a detailed breakdown of the new features added in this release.

### Terms and conditions retrieval[​](#terms-and-conditions-retrieval "Direct link to Terms and conditions retrieval")

This release adds static method `WalletFacade.fetchTermsAndConditions(configuration)`, which retrieves the current Terms and Conditions (URL and SHA-256 hash) from the network indexer. You can call it before or independently of wallet initialization. It accepts any configuration that includes `indexerClientConnection.indexerHttpUrl`, so you can pass shared wallet configuration directly.

### Promise-based query runner[​](#promise-based-query-runner "Direct link to Promise-based query runner")

This release introduces `QueryRunner.runPromise()` in `@midnight-ntwrk/wallet-sdk-indexer-client`, which executes GraphQL queries as plain Promises without Effect boilerplate. It takes a query, variables, and server config, and returns a `Promise<R>`.

***

## New features requiring configuration updates[​](#new-features-requiring-configuration-updates "Direct link to New features requiring configuration updates")

No configuration updates are required to access the new features in this release.

***

## Improvements[​](#improvements "Direct link to Improvements")

This release also includes quality and reliability improvements across wallet components.

* Node client (`@midnight-ntwrk/wallet-sdk-node-client`) now returns clearer error messages when transaction submission fails due to an invalid transaction
* DUST wallet reports more descriptive error messages when balancing fails
* `SecretKeysResource` in shielded and DUST wallets securely clears cryptographic keys from memory after use, instead of only nullifying the reference

***

## Deprecations[​](#deprecations "Direct link to Deprecations")

This release does not introduce any deprecations.

***

## Breaking changes[​](#breaking-changes "Direct link to Breaking changes")

This release includes several API and behavior changes that require migration.

### Ledger v8[​](#ledger-v8 "Direct link to Ledger v8")

The SDK is updated to Ledger v8 compatibility across all packages. Developers must upgrade their Ledger dependency to v8.

### Dynamic fee calculation (`@midnight-ntwrk/wallet-sdk-facade`, `@midnight-ntwrk/wallet-sdk-dust-wallet`)[​](#dynamic-fee-calculation-midnight-ntwrkwallet-sdk-facade-midnight-ntwrkwallet-sdk-dust-wallet "Direct link to dynamic-fee-calculation-midnight-ntwrkwallet-sdk-facade-midnight-ntwrkwallet-sdk-dust-wallet")

The previous `calculateFee` method attempted to estimate total wallet fee, but could not account for wallet coin availability or balancing transaction cost. In v3.0.0, fee computation is split into two methods:

* `calculateFee`: Computes fee for a transaction in isolation. It does not consider wallet coin set or balancing transaction cost.
* `estimateFee`: Computes the realistic total fee the current wallet would pay, including coin availability and balancing transaction cost. This method requires secret key and wallet state, and throws `InsufficientFundsError` when the wallet cannot cover the fee.

Wallet facade migration:

```
// Before (v2.0.0) - single method

const fee = await wallet.calculateTransactionFee(tx);



// After (v3.0.0) - two methods



// Fee for the transaction only (no balancing costs, no wallet context):

const txFee = await wallet.calculateTransactionFee(tx);



// Total fee the wallet would actually pay (includes balancing tx, wallet-aware):

const totalFee = await wallet.estimateTransactionFee(tx, secretKey, {

  ttl: new Date(/* ... */), // optional

  currentTime: new Date(), // optional

});
```

DUST wallet API migration:

```
// Before - single calculateFee

const fee = await dustWallet.calculateFee(transactions);



// After

// Transaction fee only (context-free):

const txOnlyFee = await dustWallet.calculateFee(transactions);



// Total fee the wallet would pay (wallet-aware, may throw InsufficientFundsError):

const totalFee = await dustWallet.estimateFee(secretKey, transactions, ttl, currentTime);
```

### `CoinSelection` type change (`@midnight-ntwrk/wallet-sdk-dust-wallet`)[​](#coinselection-type-change-midnight-ntwrkwallet-sdk-dust-wallet "Direct link to coinselection-type-change-midnight-ntwrkwallet-sdk-dust-wallet")

`CoinSelection` has changed from a target-based multi-coin selection function to a simpler single-coin selection function.

```
// Before - returned multiple coins summed to a target

type CoinSelection<T> = (coins: readonly CoinWithValue<T>[], target: bigint) => CoinWithValue<T>[];



// After - returns a single coin (smallest available) or undefined

type CoinSelection<T> = (coins: readonly CoinWithValue<T>[]) => CoinWithValue<T> | undefined;
```

### `InsufficientFundsError` (`@midnight-ntwrk/wallet-sdk-dust-wallet`)[​](#insufficientfundserror-midnight-ntwrkwallet-sdk-dust-wallet "Direct link to insufficientfundserror-midnight-ntwrkwallet-sdk-dust-wallet")

This release adds a new error type thrown by `estimateFee` when the wallet cannot cover fee requirements. It includes `message` and `tokenType` fields.

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

***

## Known issues[​](#known-issues "Direct link to Known issues")

This section lists known issues with this release of the Wallet SDK.

### Transaction history not implemented for shielded and DUST wallets[​](#transaction-history-not-implemented-for-shielded-and-dust-wallets "Direct link to Transaction history not implemented for shielded and DUST wallets")

The shielded and DUST wallets do not track transaction history. The shielded wallet transaction history getter throws "not yet implemented". Only the unshielded wallet maintains transaction records.

***

## Packages[​](#packages "Direct link to Packages")

| Package                                        | Version | Description                                                                                                                                                          |
| ---------------------------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `@midnight-ntwrk/wallet-sdk-facade`            | 3.0.0   | Unified API orchestrating shielded, unshielded, and DUST wallets. Fee calculation split into `calculateFee` and `estimateFee`. Terms and Conditions retrieval added. |
| `@midnight-ntwrk/wallet-sdk-unshielded-wallet` | 2.1.0   | Manages NIGHT and other unshielded tokens. Updated to ledger v8.                                                                                                     |
| `@midnight-ntwrk/wallet-sdk-shielded`          | 2.1.0   | Manages privacy-preserving shielded tokens. Updated to ledger v8. Securely clears secret keys from memory.                                                           |
| `@midnight-ntwrk/wallet-sdk-dust-wallet`       | 3.0.0   | Manages DUST for transaction fees. Dynamic fee calculation, `InsufficientFundsError`, and improved balancing error messages.                                         |
| `@midnight-ntwrk/wallet-sdk-capabilities`      | 3.2.0   | Shared wallet features including ProvingService, SubmissionService, and PendingTransactionsService. Updated to ledger v8.                                            |
| `@midnight-ntwrk/wallet-sdk-abstractions`      | 2.0.0   | Core interfaces and domain types. Includes shared SyncProgress and SerializedTransaction.                                                                            |
| `@midnight-ntwrk/wallet-sdk-prover-client`     | 1.2.0   | Interfaces with the prover service. Updated to ledger v8.                                                                                                            |
| `@midnight-ntwrk/wallet-sdk-indexer-client`    | 1.2.0   | Queries the Midnight indexer via GraphQL. Adds Terms and Conditions query, `QueryRunner.runPromise()`, and ledger v8 updates.                                        |
| `@midnight-ntwrk/wallet-sdk-address-format`    | 3.1.0   | Encodes and decodes Midnight addresses using Bech32m format. Updated to ledger v8.                                                                                   |
| `@midnight-ntwrk/wallet-sdk-hd`                | 3.0.1   | Derives cryptographic keys from a seed following BIP-32/BIP-44/CIP-1852.                                                                                             |
| `@midnight-ntwrk/wallet-sdk-node-client`       | 1.1.0   | Communicates with Midnight nodes. Improved invalid transaction error messages and ledger v8 support.                                                                 |
| `@midnight-ntwrk/wallet-sdk-utilities`         | 1.1.0   | Common utilities. Dev-only dependencies cleaned up and ledger v8 support added.                                                                                      |
| `@midnight-ntwrk/wallet-sdk-runtime`           | 1.0.2   | Orchestrates wallet lifecycle and state management.                                                                                                                  |

***

## Fixed defect list[​](#fixed-defect-list "Direct link to Fixed defect list")

This release includes the following defect fixes:

* Shielded wallet now correctly clears pending coins when a transaction fails; previously, pending coins were not released on failure, which could reduce available balances until restart
* `SecretKeysResource` in shielded and DUST wallets now securely clears cryptographic keys from memory after use, instead of only nullifying the reference
* Node client returns clearer error messages when transaction submission fails due to an invalid transaction
* DUST wallet reports more descriptive error messages when balancing fails
* Dev-only dependencies moved out of production dependencies in `@midnight-ntwrk/wallet-sdk-utilities`

***

## Links and references[​](#links-and-references "Direct link to Links and references")

* **SDK documentation**: [Wallet developer guide](https://docs.midnight.network/sdks/official/wallet-developer-guide.md)
* **Examples**: [SDK example snippets](https://github.com/midnightntwrk/midnight-wallet/tree/main/packages/docs-snippets/src/snippets)
* **GitHub repository**: [Midnight wallet](https://github.com/midnightntwrk/midnight-wallet)
* **API reference**: [DApp Connector API](https://docs.midnight.network/api-reference/dapp-connector-api)
