Ver código fonte

Prepare v0.15 (#1623)

* chore: update changelog for 0.15.0

* docs: migrations for 0.15 docs

* feat: Migration to melt docs

* chore: bump version to 0.15.0
tsk 1 semana atrás
pai
commit
d0b9bd5c5f
6 arquivos alterados com 533 adições e 112 exclusões
  1. 95 50
      CHANGELOG.md
  2. 23 23
      Cargo.lock
  3. 22 22
      Cargo.toml
  4. 350 0
      docs/migrations/v0.15.md
  5. 2 2
      flake.nix
  6. 41 15
      justfile

+ 95 - 50
CHANGELOG.md

@@ -7,16 +7,107 @@
 
 ## [Unreleased]
 
+## [0.15.0](https://github.com/cashubtc/cdk/releases/tag/v0.15.0)
+
+### Summary
+
+Version 0.15.0 introduces **Wallet Sagas**, a major architectural improvement that brings the saga pattern to all wallet operations for robust error recovery and crash resilience. This release also adds async wallet operations support and NUT-26 (Payment Request Bech32m Encoding) for compatibility with BIP-321 and BIP-353 human-readable addresses.
+
+Key highlights include:
+- **Wallet Sagas**: All wallet operations (mint, melt, send, receive, swap) now use the saga pattern with type-state safety and automatic compensation actions
+- **Melt Flow Redesign**: New two-phase prepare/confirm pattern for melts with `PreparedMelt`, similar to `PreparedSend`
+- **Async Wallet Operations**: Non-blocking melt operations via `prefer` field - returns immediately with a `PendingMelt` future that can be awaited immediately OR dropped to complete via WebSocket notifications or background recovery
+- **NUT-26**: Payment Request Bech32m Encoding support (CREQ-B format) - provides better QR code compatibility and enables integration with BIP-321/BIP-353 human-readable addresses
+- **Breaking Change**: MultiMintWallet has been removed - use `WalletRepository` instead
+- Authentication (NUT-21/NUT-22) is now always enabled - the `auth` feature flag has been removed
+- Keyset V2 is now the default for new keysets
+
 ### Added
-- cdk: Add `get_all_mint_info` to MultiMintWallet ([thesimplekid]).
+- cdk: Wallet saga pattern for all wallet operations (mint, melt, send, receive, swap) with type-state pattern and compensation actions ([thesimplekid]).
+- cdk: `Wallet::recover_incomplete_sagas()` method to recover from interrupted operations and prevent proofs from being stuck in reserved states ([thesimplekid]).
+- cdk: `Wallet::prepare_melt()` and `Wallet::prepare_melt_proofs()` to create `PreparedMelt` for two-phase melt operations ([thesimplekid]).
+- cdk: `PreparedMelt` with `confirm()`, `confirm_with_options()`, `confirm_prefer_async()`, and `cancel()` methods for controlled melt execution ([thesimplekid]).
+- cdk: `MeltConfirmOptions` to configure melt behavior (e.g., `skip_swap`) ([thesimplekid]).
+- cdk: `MeltOutcome` enum with `Paid` (immediate completion) or `Pending` variants - `Pending` returns a `PendingMelt` that can be awaited immediately OR dropped to complete via WebSocket notifications or `Wallet::finalize_pending_melts()` ([thesimplekid]).
+- cdk: `PendingMelt` struct that implements `IntoFuture` for awaiting async melt completion ([thesimplekid]).
+- cdk: `Wallet::finalize_pending_melts()` to recover and complete pending melt operations after crash ([thesimplekid]).
+- cdk: Async wallet operations support using `prefer` field in request body ([thesimplekid]).
+- cdk: NUT-26 Payment Request Bech32m Encoding support (CREQ-B format as an alternative to NUT-18's CREQ-A) ([thesimplekid]).
+- cdk: `WalletRepository` as a simpler replacement for MultiMintWallet - manages Wallet instances by mint URL and currency unit with direct access to Wallet methods ([asmo]).
+- cdk: `WalletRepositoryBuilder` for constructing WalletRepository with configurable proxy, Tor, and database settings ([asmo]).
+- cdk: `WalletConfig` for per-wallet customization of connectors, target proof counts, and metadata cache TTL ([asmo]).
+- cdk: `TokenData` struct for extracting mint URL, proofs, and metadata from parsed tokens ([asmo]).
+- cdk: Keyset V2 configuration with `use_keyset_v2` setting - defaults to V2 for new keysets while preserving existing keyset versions ([thesimplekid]).
+- cdk: Input and output limits for swap, melt, and other transactions to prevent DoS attacks ([thesimplekid]).
+- cdk: Glob pattern support for NUT-21/22 route validation ([thesimplekid]).
+- cdk: `Wallet::fetch_mint_quote()` method to retrieve mint quote by ID ([asmo]).
+- cdk-ldk-node: BIP39 mnemonic seed configuration ([asmo]).
+- cdk-ldk-node: Configurable announcement addresses ([asmo]).
+- cdk-ldk-node: Configurable logging settings ([asmo]).
 
-## [0.14.0](https://github.com/cashubtc/cdk/releases/tag/v0.14.0)
+### Changed
+- cdk: **BREAKING** - Removed `MultiMintWallet` and all its methods - use `WalletRepository` instead for managing multiple wallets ([asmo]).
+- cdk: **BREAKING** - Removed `auth` feature flag - authentication code (NUT-21/NUT-22) is now always compiled ([crodas]).
+- cdk: Melt operations now use the saga pattern with type-state safety and automatic compensation on failure ([thesimplekid]).
+- cdk: `PreparedMelt`, `PreparedSend`, and other prepared structs marked with `#[must_use]` to prevent accidental drops ([thesimplekid]).
+- cashu: Default features are now off ([thesimplekid]).
+- cdk-common: Abstracted HTTP client behind `cdk_common::HttpClient` ([crodas]).
 
-### Summary
+### Fixed
+- cdk: Fee conversion in payment backend ([thesimplekid]).
+- cdk: Mint publishes quote back to unpaid state on failure ([thesimplekid]).
+- cdk: Add error code for input and output limits ([thesimplekid]).
+- cdk-sqlite: Correct SQLite connection pool size check ([crodas]).
 
-This release focuses on reliability and robustness improvements across the codebase. The mint now implements saga patterns for both melt and swap operations, providing better error recovery and state consistency during these critical operations. Async melt processing has been added for improved throughput. The wallet gains a new Tor mint connector with isolated circuits support for enhanced privacy when communicating with mints, along with a MintMetadataCache that delivers significant performance improvements for key and metadata management. A new proof recovery mechanism automatically handles failed wallet operations. MultiMintWallet receives improvements including the ability to check and wait for mint quotes and configure internal wallets. NUT-11 SIG_ALL message aggregation has been updated to match the latest specification. On the infrastructure side, a generic pubsub module has been introduced in cdk-common, and cdk-ffi adds postgres support. Additional highlights include keyset amount tracking and SQL balance calculation optimization for improved performance, wallet functions to pay human readable addresses (BIP353 and Lightning address), invoice decoding for BOLT11 and BOLT12 in the FFI bindings, and a mutation testing infrastructure to ensure security-critical code coverage. The release also brings numerous bug fixes addressing database contention, HTLC witness handling, and quote state management.
+### Removed
+- cdk: MultiMintWallet and all associated methods ([asmo]).
+- cdk: `auth` feature flag and all conditional compilation paths ([crodas]).
+
+## [0.14.3](https://github.com/cashubtc/cdk/releases/tag/v0.14.3)
+
+### Added
+- cdk-ffi: Export token creation from raw bytes ([cloudsupper]).
+### Fixed
+- cdk: Batch proof witness queries in check_state to prevent pool exhaustion ([thesimplekid]).
+- cdk-mint-rpc: Set payment_id and payment_amount when moving mint_quote into PAID state ([asmo]).
+- cdk: Fix fee_ppk unit mismatch in select_exact_proofs ([thesimplekid]).
+- cdk: Fix wallet restore gaps ([thesimplekid]).
+## [0.14.2](https://github.com/cashubtc/cdk/releases/tag/v0.14.2)
+### Added
+- cdk-ffi: Add Payment Requests support ([thesimplekid]).
+- cdk-ffi: Add multimint melt with mint functionality ([thesimplekid]).
+- cdk-ffi: Add get wallets functionality ([thesimplekid]).
+- cdk: Add MultiMintWallet function to check proofs state ([thesimplekid]).
+- cdk: Add get_token_data and get_mint_keysets to MultiMintWallet ([thesimplekid]).
+- cdk: Melt external support ([thesimplekid]).
+### Changed
+- cdk: Swap before melt ([thesimplekid]).
+- cdk: Use try proof in swap within melt ([thesimplekid]).
+
+### Fixed
+- cdk-ffi: Check melt quote in FFI ([thesimplekid]).
+- cdk: Use the client id from mint configuration ([lescuer97]).
+- cdk: Fix proof selection with fees to ensure net amount meets target ([thesimplekid]).
+- cdk: Do not remove melt quote ([thesimplekid]).
+- cdk: Return TransactionUnbalanced error for empty swap inputs/outputs ([thesimplekid]).
+- cdk: Fix connection pool resource initialization and path validation ([thesimplekid]).
+- cdk: Fix WASM use web_time ([thesimplekid]).
+
+## [0.14.1](https://github.com/cashubtc/cdk/releases/tag/v0.14.1)
+
+### Added
+- cdk: Add MultiMintWallet human-readable address melt quote support (BIP353 and Lightning address) ([thesimplekid]).
+- cdk-ffi: Add metadata cache TTL configuration methods ([thesimplekid]).
+### Changed
+- cdk: Ensure mint info is loaded before quote operations ([thesimplekid]).
+- cdk: Replace deferred database persistence with synchronous writes in mint metadata cache ([thesimplekid]).
 
 ### Added
+- cdk: Add `get_all_mint_info` to MultiMintWallet ([thesimplekid]).
+## [0.14.0](https://github.com/cashubtc/cdk/releases/tag/v0.14.0)
+### Summary
+This release focuses on reliability and robustness improvements across the codebase. The mint now implements saga patterns for both melt and swap operations, providing better error recovery and state consistency during these critical operations. Async melt processing has been added for improved throughput. The wallet gains a new Tor mint connector with isolated circuits support for enhanced privacy when communicating with mints, along with a MintMetadataCache that delivers significant performance improvements for key and metadata management. A new proof recovery mechanism automatically handles failed wallet operations. MultiMintWallet receives improvements including the ability to check and wait for mint quotes and configure internal wallets. NUT-11 SIG_ALL message aggregation has been updated to match the latest specification. On the infrastructure side, a generic pubsub module has been introduced in cdk-common, and cdk-ffi adds postgres support. Additional highlights include keyset amount tracking and SQL balance calculation optimization for improved performance, wallet functions to pay human readable addresses (BIP353 and Lightning address), invoice decoding for BOLT11 and BOLT12 in the FFI bindings, and a mutation testing infrastructure to ensure security-critical code coverage. The release also brings numerous bug fixes addressing database contention, HTLC witness handling, and quote state management.
+### Added
 - cdk: Add wallet functions to pay human readable addresses (BIP353 and Lightning address) ([thesimplekid]).
 - cdk-ffi: Add invoice decoding for bolt11 and bolt12 ([thesimplekid]).
 - cdk: Add keyset_amounts table to track issued and redeemed amounts for improved performance ([crodas]).
@@ -32,7 +123,6 @@ This release focuses on reliability and robustness improvements across the codeb
 - cdk: Allow passing metadata to a melt ([benthecarman]).
 - cashu: Include supported amounts instead of assuming the power of 2 ([crodas]).
 - test: Add mutation testing infrastructure and security-critical coverage ([thesimplekid]).
-
 ### Changed
 - cdk: Introduce MintMetadataCache for efficient key and metadata management ([crodas]).
 - cdk: Implement saga pattern for melt operations ([thesimplekid]).
@@ -79,17 +169,12 @@ This release focuses on reliability and robustness improvements across the codeb
 ### Added
 - cdk-lnbits: Update LNbits integration ([thesimplekid]).
 - cdk: Clean witness data ([thesimplekid]).
-
 ## [0.13.3](https://github.com/cashubtc/cdk/releases/tag/v0.13.3)
-
 ### Fixed
 - cdk-lnbits: Fix lnbits fee calc ([thesimplekid]).
-
 ## [0.13.2](https://github.com/cashubtc/cdk/releases/tag/v0.13.2)
-
 ### Added
 - cashu: Add spending-condition inspection helpers and token_secrets() ([lollerfirst]).
-
 ### Changed
 - cdk: Make sorting Transactions a stable sort ([benthecarman]).
 - Updated stable Rust to 1.85.0 ([thesimplekid]).
@@ -140,8 +225,6 @@ Version 0.13.0 marks a major milestone for mobile development with the introduct
 - cdk-mintd: Optional Prometheus metrics server with configurable address/port via config and env vars (feature: `prometheus`) ([thesimplekid]).
 - cdk-ldk-node: Web UI improvements (dynamic status, navigation, mobile support) ([erik]).
 - cdk-postgres: Dedicated auth database support with separate schema and migrations when auth is enabled ([thesimplekid]/[asmo]).
-
-
 ### Changed
 - cdk-common: Refactored `MintPayment` trait method `wait_any_incoming_payment` to `wait_payment_event` with event-driven architecture ([thesimplekid]).
 - cdk-common: Updated `wait_payment_event` return type to stream `Event` enum instead of `WaitPaymentResponse` directly ([thesimplekid]).
@@ -206,7 +289,6 @@ Version 0.12.0 delivers end-to-end BOLT12 offers and payments, adds BIP‑353 ad
 - cdk: Log-to-file support ([thesimplekid]).
 - cdk(wallet): BIP-353 support ([thesimplekid]).
 - security: Zeroize secrets on drop ([vnprc]).
-
 ### Changed
 - cdk-common: Modified `Database::get_keyset_counter` trait method to return `u32` instead of `Option<u32>` for simpler keyset counter handling ([thesimplekid]).
 - cdk: Refactored wallet keyset management methods for better clarity and separation of concerns ([thesimplekid]).
@@ -284,7 +366,6 @@ If you are currently running a mint with redb, you must migrate to SQLite before
 - Database transaction support [PR](https://github.com/cashubtc/cdk/pull/826) ([crodas]).
 - Support for multsig refund [PR](https://github.com/cashubtc/cdk/pull/860) ([thesimplekid]).
 - Convert unit helper fn [PR](https://github.com/cashubtc/cdk/pull/856) ([davidcaseria]).
-
 ### Changed
 - cdk-sqlite: remove sqlx in favor of rusqlite ([crodas]).
 - cdk-lnd: use custom tonic gRPC instead of fedimint-tonic-grpc [PR](https://github.com/cashubtc/cdk/pull/831) ([thesimplekid]).
@@ -311,7 +392,6 @@ If you are currently running a mint with redb, you must migrate to SQLite before
 - Mint URL flag option [PR](https://github.com/cashubtc/cdk/pull/765) ([thesimplekid]).
 - Export NUT-06 supported settings field [PR](https://github.com/cashubtc/cdk/pull/764) ([davidcaseria]).
 - Docker build workflow for arm64 images [PR](https://github.com/cashubtc/cdk/pull/770) ([asmo]).
-
 ### Changed
 - cdk-redb: Removed mint storage functionality to be wallet-only ([thesimplekid]).
 - Updated Nix flake to 25.05 and removed Nix cache [PR](https://github.com/cashubtc/cdk/pull/769) ([thesimplekid]).
@@ -331,7 +411,6 @@ If you are currently running a mint with redb, you must migrate to SQLite before
 - HTLC from hash support [PR](https://github.com/cashubtc/cdk/pull/753) ([thesimplekid]).
 - Optional transport and NUT-10 secret on payment request [PR](https://github.com/cashubtc/cdk/pull/744) ([thesimplekid]).
 - Multi-part payments support in cdk-cli [PR](https://github.com/cashubtc/cdk/pull/743) ([thesimplekid]).
-
 ### Changed
 - Refactored Lightning module to use common types [PR](https://github.com/cashubtc/cdk/pull/751) ([thesimplekid]).
 - Updated LND to support mission control and improved requery behavior [PR](https://github.com/cashubtc/cdk/pull/746) ([lollerfirst]).
@@ -363,7 +442,6 @@ If you are currently running a mint with redb, you must migrate to SQLite before
 - Amountless invoices [NUT](https://github.com/cashubtc/nuts/pull/173) [PR](https://github.com/cashubtc/cdk/pull/497) ([thesimplekid]).
 - `create_time`, `paid_time` to mint and melt quotes [PR](https://github.com/cashubtc/cdk/pull/708) ([thesimplekid]).
 - cdk-mint-rpc: Added get mint and melt quotes ttl [PR](https://github.com/cashubtc/cdk/pull/716) ([thesimplekid]).
-
 ### Changed
 - cashu: Move wallet mod to cdk-common ([thesimplekid]).
 - Export Mint DB Traits [PR](https://github.com/cashubtc/cdk/pull/710) ([davidcaseria]).
@@ -418,13 +496,11 @@ If you are currently running a mint with redb, you must migrate to SQLite before
 - Utility functions for Proofs ([davidcaseria]).
 - Utility functions for SendKind ([davidcaseria]).
 - Completed checked arithmetic operations for Amount (i.e., checked_mul and checked_div) ([davidcaseria]).
-
 ### Removed
 - Remove support for Memory Database in cdk ([crodas]).
 - Remove `AmountStr` ([crodas]).
 - Remove `get_nostr_last_checked` from `WalletDatabase` ([thesimplekid]).
 - Remove `add_nostr_last_checked` from `WalletDatabase` ([thesimplekid]).
-
 ## [cdk-mintd:v0.7.4](https://github.com/cashubtc/cdk/releases/tag/cdk-mintd-v0.7.4)
 ### Changed
 - cdk-mintd: Update to cdk v0.7.2 ([thesimplekid]).
@@ -447,11 +523,8 @@ If you are currently running a mint with redb, you must migrate to SQLite before
 
 ### Added
 - cdk: Mint builder add ability to set custom derivation paths ([thesimplekid]).
-
 ### Fixed
 - cdk-cln: Return error on stream error ([thesimplekid]).
-
-
 ## [v0.7.0](https://github.com/cashubtc/cdk/releases/tag/v0.7.0)
 ### Changed
 - Moved db traits to `cdk-common` ([crodas]).
@@ -466,21 +539,16 @@ If you are currently running a mint with redb, you must migrate to SQLite before
 - cdk-mint-rpc: Mint management gRPC client and server ([thesimplekid]).
 - cdk-common: cdk specific types and traits ([crodas]).
 - cashu: Core types and functions defined in NUTs ([crodas]).
-
 ### Fixed
 - Multimint unit check when wallet receiving token ([thesimplekid]).
 - Mint start up with most recent keyset after a rotation ([thesimplekid]).
-
-
 ## [cdk-v0.6.1, cdk-mintd-v0.6.2](https://github.com/cashubtc/cdk/releases/tag/cdk-mintd-v0.6.1)
 ### Fixed
 - cdk: Missing check on mint that outputs equals the quote amount ([thesimplekid]).
 - cdk: Reset mint quote status if in state that cannot continue ([thesimplekid]).
-
 ## [v0.6.1](https://github.com/cashubtc/cdk/releases/tag/cdk-v0.6.1)
 ### Added
 - cdk-mintd: Get work-dir from env var ([thesimplekid]).
-
 ## [v0.6.0](https://github.com/cashubtc/cdk/releases/tag/v0.6.0)
 ### Changed
 - cdk: Enforce `quote_id` to uuid type in mint ([tdelabro]).
@@ -492,14 +560,12 @@ If you are currently running a mint with redb, you must migrate to SQLite before
 - cdk-axum: Redis cache backend ([crodas]).
 - cdk-mints: Get mint settings from env vars ([thesimplekid]).
 - cdk-axum: HTTP compression support ([ok300]).
-
 ### Fixed
 - cdk-sqlite: Keyset counter was overwritten when keyset was fetched from mint ([thesimplekid]).
 - cdk-cli: On `mint` use `unit` from cli args ([thesimplekid]).
 - cdk-cli: On `restore` create `wallet` if it does not exist ([thesimplekid]).
 - cdk: Signaling support for optional nuts ([thesimplekid]).
 - cdk-phd: Check payment has valid uuid ([thesimplekid]).
-
 ## [v0.5.0](https://github.com/cashubtc/cdk/releases/tag/v0.5.0)
 ### Changed
 - cdk: Bump `bitcoin` to `0.32.2` ([prusnak]).
@@ -533,19 +599,13 @@ If you are currently running a mint with redb, you must migrate to SQLite before
 - cdk: NUT18 payment request support ([thesimplekid]).
 - cdk: Add `Wallet::get_proofs_with` ([ok300]).
 - cdk: Mint NUT-17 Websocket support ([crodas]).
-
 ### Removed
 - cdk: Remove `MintMeltSettings` since it is no longer used ([lollerfirst]).
 - cdk: `PaymentMethod::Custom` ([thesimplekid]).
 - cdk: Remove deprecated `MeltBolt11Response` ([thesimplekid]).
-
 ### Fixed
 - cdk: Check of inputs to include fee ([thesimplekid]).
 - cdk: Make unit mandatory in tokenv4 ([ok300]).
-
-
-
-
 ## [v0.4.0](https://github.com/cashubtc/cdk/releases/tag/v0.4.0)
 ### Changed
 - cdk: Reduce MSRV to 1.63.0 ([thesimplekid]).
@@ -564,15 +624,11 @@ If you are currently running a mint with redb, you must migrate to SQLite before
 
 ### Added
 - cdk: Multiple error types ([thesimplekid]).
-
 ### Fixed
 - cdk(mint): Use checked addition on amount to ensure there is no overflow ([thesimplekid]).
-
 ### Removed
 - cdk(wallet): Removed CDK wallet error ([thesimplekid]).
 - cdk(mint): Removed CDK mint error ([thesimplekid]).
-
-
 ## [v0.3.0](https://github.com/cashubtc/cdk/releases/tag/v0.3.0)
 ### Changed
 - cdk(wallet): `fn send` returns `Token` so the user can use the struct of convert it to a v3 or v4 string ([thesimplekid]).
@@ -606,29 +662,22 @@ If you are currently running a mint with redb, you must migrate to SQLite before
 - cdk: Add `MintUrl` that sanitizes mint url by removing trailing `/` ([cjbeery24]).
 - cdk(cdk-database/mint): Add `update_proofs` that both adds new `ProofInfo`s to the db and deletes ([davidcaseria]).
 - cdk(cdk-database/mint): Add `set_pending_proofs`, `reserve_proofs`, and `set_unspent_proofs` ([davidcaseria]).
-
-
 ### Fixed
 - cdk(mint): `SIG_ALL` is not allowed in `melt` ([thesimplekid]).
 - cdk(mint): On `swap` verify correct number of sigs on outputs when `SigAll` ([thesimplekid]).
 - cdk(mint): Use amount in payment_quote response from ln backend ([thesimplekid]).
 - cdk(mint): Create new keysets for added supported units ([thesimplekid]).
 - cdk(mint): If there is an error in swap proofs should be reset to unspent ([thesimplekid]).
-
 ### Removed
 - cdk(wallet): Remove unused argument `SplitTarget` on `melt` ([thesimplekid]).
 - cdk(cdk-database/mint): Remove `get_spent_proofs`, `get_spent_proofs_by_ys`,`get_pending_proofs`, `get_pending_proofs_by_ys`, and `remove_pending_proofs` ([thesimplekid]).
 - cdk: Remove `UncheckedUrl` in favor of `MintUrl` ([cjbeery24]).
 - cdk(cdk-database/mint): Remove `set_proof_state`, `remove_proofs` and `add_proofs` ([davidcaseria]).
-
 ## [v0.2.0](https://github.com/cashubtc/cdk/releases/tag/v0.2.0)
 ### Summary
 This release introduces TokenV4, which uses CBOR encoding as the default token format. It also includes fee support for both wallet and mint operations.
-
 When sending, the sender can choose to include the necessary fee to ensure that the receiver can redeem the full sent amount. If this is not done, the receiver will be responsible for the fee.
-
 Additionally, this release introduces a Mint binary cdk-mintd that uses the cdk-axum crate as a web server to create a full Cashu mint. When paired with a Lightning backend, currently implemented as Core Lightning, it is included in this release as cdk-cln.
-
 ### Changed
 - cdk(wallet): `wallet:receive` will not claim `proofs` from a mint other than the wallet's mint ([thesimplekid]).
 - cdk(NUT00): `Token` is changed from a `struct` to `enum` of either `TokenV4` or `Tokenv3` ([thesimplekid]).
@@ -647,18 +696,14 @@ Additionally, this release introduces a Mint binary cdk-mintd that uses the cdk-
 - cdk: NUT06 `MintInfo` and `NUTs` builder ([thesimplekid]).
 - cdk: NUT00 `PreMintSecret` added Keyset id ([thesimplekid]).
 - cdk: NUT02 Support fees ([thesimplekid]).
-
 ### Fixed
 - cdk: NUT06 deserialize `MintInfo` ([thesimplekid]).
-
-
 ## [v0.1.1](https://github.com/cashubtc/cdk/releases/tag/v0.1.1)
 ### Changed
 - cdk(wallet): `wallet::total_pending_balance` does not include reserved proofs ([thesimplekid]).
 
 ### Added
 - cdk(wallet): Added get reserved proofs ([thesimplekid]).
-
 <!-- Contributors -->
 [thesimplekid]: https://github.com/thesimplekid
 [davidcaseria]: https://github.com/davidcaseria

+ 23 - 23
Cargo.lock

@@ -1109,7 +1109,7 @@ dependencies = [
 
 [[package]]
 name = "cashu"
-version = "0.14.0"
+version = "0.15.0-rc.0"
 dependencies = [
  "bip39",
  "bitcoin 0.32.8",
@@ -1181,7 +1181,7 @@ dependencies = [
 
 [[package]]
 name = "cdk"
-version = "0.14.0"
+version = "0.15.0-rc.0"
 dependencies = [
  "anyhow",
  "arc-swap",
@@ -1235,7 +1235,7 @@ dependencies = [
 
 [[package]]
 name = "cdk-axum"
-version = "0.14.0"
+version = "0.15.0-rc.0"
 dependencies = [
  "anyhow",
  "async-trait",
@@ -1257,7 +1257,7 @@ dependencies = [
 
 [[package]]
 name = "cdk-cli"
-version = "0.14.0"
+version = "0.15.0-rc.0"
 dependencies = [
  "anyhow",
  "bip39",
@@ -1281,7 +1281,7 @@ dependencies = [
 
 [[package]]
 name = "cdk-cln"
-version = "0.14.0"
+version = "0.15.0-rc.0"
 dependencies = [
  "async-trait",
  "bitcoin 0.32.8",
@@ -1298,7 +1298,7 @@ dependencies = [
 
 [[package]]
 name = "cdk-common"
-version = "0.14.0"
+version = "0.15.0-rc.0"
 dependencies = [
  "anyhow",
  "async-trait",
@@ -1335,7 +1335,7 @@ dependencies = [
 
 [[package]]
 name = "cdk-fake-wallet"
-version = "0.14.0"
+version = "0.15.0-rc.0"
 dependencies = [
  "async-trait",
  "bitcoin 0.32.8",
@@ -1355,7 +1355,7 @@ dependencies = [
 
 [[package]]
 name = "cdk-ffi"
-version = "0.14.0"
+version = "0.15.0-rc.0"
 dependencies = [
  "android_logger",
  "async-trait",
@@ -1384,7 +1384,7 @@ dependencies = [
 
 [[package]]
 name = "cdk-http-client"
-version = "0.14.0"
+version = "0.15.0-rc.0"
 dependencies = [
  "mockito",
  "regex",
@@ -1398,7 +1398,7 @@ dependencies = [
 
 [[package]]
 name = "cdk-integration-tests"
-version = "0.14.0"
+version = "0.15.0-rc.0"
 dependencies = [
  "anyhow",
  "async-trait",
@@ -1441,7 +1441,7 @@ dependencies = [
 
 [[package]]
 name = "cdk-ldk-node"
-version = "0.14.0"
+version = "0.15.0-rc.0"
 dependencies = [
  "async-trait",
  "axum 0.8.8",
@@ -1466,7 +1466,7 @@ dependencies = [
 
 [[package]]
 name = "cdk-lnbits"
-version = "0.14.0"
+version = "0.15.0-rc.0"
 dependencies = [
  "anyhow",
  "async-trait",
@@ -1484,7 +1484,7 @@ dependencies = [
 
 [[package]]
 name = "cdk-lnd"
-version = "0.14.0"
+version = "0.15.0-rc.0"
 dependencies = [
  "anyhow",
  "async-trait",
@@ -1509,7 +1509,7 @@ dependencies = [
 
 [[package]]
 name = "cdk-mint-rpc"
-version = "0.14.0"
+version = "0.15.0-rc.0"
 dependencies = [
  "anyhow",
  "cdk",
@@ -1531,7 +1531,7 @@ dependencies = [
 
 [[package]]
 name = "cdk-mintd"
-version = "0.14.0"
+version = "0.15.0-rc.0"
 dependencies = [
  "anyhow",
  "async-trait",
@@ -1570,7 +1570,7 @@ dependencies = [
 
 [[package]]
 name = "cdk-npubcash"
-version = "0.14.0"
+version = "0.15.0-rc.0"
 dependencies = [
  "async-trait",
  "base64 0.22.1",
@@ -1593,7 +1593,7 @@ dependencies = [
 
 [[package]]
 name = "cdk-payment-processor"
-version = "0.14.0"
+version = "0.15.0-rc.0"
 dependencies = [
  "anyhow",
  "async-trait",
@@ -1630,7 +1630,7 @@ dependencies = [
 
 [[package]]
 name = "cdk-postgres"
-version = "0.14.0"
+version = "0.15.0-rc.0"
 dependencies = [
  "async-trait",
  "bitcoin 0.32.8",
@@ -1653,7 +1653,7 @@ dependencies = [
 
 [[package]]
 name = "cdk-prometheus"
-version = "0.14.0"
+version = "0.15.0-rc.0"
 dependencies = [
  "anyhow",
  "futures",
@@ -1671,7 +1671,7 @@ dependencies = [
 
 [[package]]
 name = "cdk-redb"
-version = "0.14.0"
+version = "0.15.0-rc.0"
 dependencies = [
  "async-trait",
  "cdk-common",
@@ -1689,7 +1689,7 @@ dependencies = [
 
 [[package]]
 name = "cdk-signatory"
-version = "0.14.0"
+version = "0.15.0-rc.0"
 dependencies = [
  "anyhow",
  "async-trait",
@@ -1714,7 +1714,7 @@ dependencies = [
 
 [[package]]
 name = "cdk-sql-common"
-version = "0.14.0"
+version = "0.15.0-rc.0"
 dependencies = [
  "async-trait",
  "bitcoin 0.32.8",
@@ -1732,7 +1732,7 @@ dependencies = [
 
 [[package]]
 name = "cdk-sqlite"
-version = "0.14.0"
+version = "0.15.0-rc.0"
 dependencies = [
  "async-trait",
  "bitcoin 0.32.8",

+ 22 - 22
Cargo.toml

@@ -36,7 +36,7 @@ rust-version = "1.85.0"
 license = "MIT"
 homepage = "https://github.com/cashubtc/cdk"
 repository = "https://github.com/cashubtc/cdk.git"
-version = "0.14.0"
+version = "0.15.0-rc.0"
 readme = "README.md"
 
 [workspace.dependencies]
@@ -46,27 +46,27 @@ axum = { version = "0.8.1", features = ["ws"] }
 bitcoin = { version = "0.32.2", features = ["base64", "serde", "rand", "rand-std"] }
 bip39 = { version = "2.0", features = ["rand"] }
 jsonwebtoken = "9.2.0"
-cashu = { path = "./crates/cashu", default-features = false, version = "=0.14.0" }
-cdk = { path = "./crates/cdk", default-features = false, version = "=0.14.0" }
-cdk-common = { path = "./crates/cdk-common", default-features = false, version = "=0.14.0" }
-cdk-axum = { path = "./crates/cdk-axum", default-features = false, version = "=0.14.0" }
-cdk-cln = { path = "./crates/cdk-cln", version = "=0.14.0" }
-cdk-lnbits = { path = "./crates/cdk-lnbits", version = "=0.14.0" }
-cdk-lnd = { path = "./crates/cdk-lnd", version = "=0.14.0" }
-cdk-ldk-node = { path = "./crates/cdk-ldk-node", version = "=0.14.0" }
-cdk-fake-wallet = { path = "./crates/cdk-fake-wallet", version = "=0.14.0" }
-cdk-ffi = { path = "./crates/cdk-ffi", version = "=0.14.0" }
-cdk-payment-processor = { path = "./crates/cdk-payment-processor", default-features = true, version = "=0.14.0" }
-cdk-mint-rpc = { path = "./crates/cdk-mint-rpc", version = "=0.14.0" }
-cdk-redb = { path = "./crates/cdk-redb", default-features = true, version = "=0.14.0" }
-cdk-sql-common = { path = "./crates/cdk-sql-common", default-features = true, version = "=0.14.0" }
-cdk-sqlite = { path = "./crates/cdk-sqlite", default-features = true, version = "=0.14.0" }
-cdk-postgres = { path = "./crates/cdk-postgres", default-features = true, version = "=0.14.0" }
-cdk-signatory = { path = "./crates/cdk-signatory", version = "=0.14.0", default-features = false }
-cdk-mintd = { path = "./crates/cdk-mintd", version = "=0.14.0", default-features = false }
-cdk-prometheus = { path = "./crates/cdk-prometheus", version = "=0.14.0", default-features = false }
-cdk-npubcash = { path = "./crates/cdk-npubcash", version = "=0.14.0" }
-cdk-http-client = { path = "./crates/cdk-http-client", version = "=0.14.0" }
+cashu = { path = "./crates/cashu", default-features = false, version = "=0.15.0-rc.0" }
+cdk = { path = "./crates/cdk", default-features = false, version = "=0.15.0-rc.0" }
+cdk-common = { path = "./crates/cdk-common", default-features = false, version = "=0.15.0-rc.0" }
+cdk-axum = { path = "./crates/cdk-axum", default-features = false, version = "=0.15.0-rc.0" }
+cdk-cln = { path = "./crates/cdk-cln", version = "=0.15.0-rc.0" }
+cdk-lnbits = { path = "./crates/cdk-lnbits", version = "=0.15.0-rc.0" }
+cdk-lnd = { path = "./crates/cdk-lnd", version = "=0.15.0-rc.0" }
+cdk-ldk-node = { path = "./crates/cdk-ldk-node", version = "=0.15.0-rc.0" }
+cdk-fake-wallet = { path = "./crates/cdk-fake-wallet", version = "=0.15.0-rc.0" }
+cdk-ffi = { path = "./crates/cdk-ffi", version = "=0.15.0-rc.0" }
+cdk-payment-processor = { path = "./crates/cdk-payment-processor", default-features = true, version = "=0.15.0-rc.0" }
+cdk-mint-rpc = { path = "./crates/cdk-mint-rpc", version = "=0.15.0-rc.0" }
+cdk-redb = { path = "./crates/cdk-redb", default-features = true, version = "=0.15.0-rc.0" }
+cdk-sql-common = { path = "./crates/cdk-sql-common", default-features = true, version = "=0.15.0-rc.0" }
+cdk-sqlite = { path = "./crates/cdk-sqlite", default-features = true, version = "=0.15.0-rc.0" }
+cdk-postgres = { path = "./crates/cdk-postgres", default-features = true, version = "=0.15.0-rc.0" }
+cdk-signatory = { path = "./crates/cdk-signatory", version = "=0.15.0-rc.0", default-features = false }
+cdk-mintd = { path = "./crates/cdk-mintd", version = "=0.15.0-rc.0", default-features = false }
+cdk-prometheus = { path = "./crates/cdk-prometheus", version = "=0.15.0-rc.0", default-features = false }
+cdk-npubcash = { path = "./crates/cdk-npubcash", version = "=0.15.0-rc.0" }
+cdk-http-client = { path = "./crates/cdk-http-client", version = "=0.15.0-rc.0" }
 clap = { version = "4.5.31", features = ["derive"] }
 ciborium = { version = "0.2.2", default-features = false, features = ["std"] }
 cbor-diag = "0.1.12"

+ 350 - 0
docs/migrations/v0.15.md

@@ -0,0 +1,350 @@
+# Migration Guide: v0.14.x to v0.15.0
+
+## Summary
+
+**Two major breaking changes:**
+
+1. **`MultiMintWallet` removed** → Use `WalletRepository` to get individual `Wallet` instances
+2. **Melt saga pattern** → `confirm()` returns `MeltOutcome` (Paid or Pending), with async support
+
+**Key Changes:**
+- `wallet.mint_quote(&mint_url, ...)` → `wallet.get_wallet(&mint_url, &unit)?.mint_quote(...)`
+- `prepared_melt.confirm().await?` → `match prepared_melt.confirm().await? { MeltOutcome::Paid(_) => ..., MeltOutcome::Pending(_) => ... }`
+
+## Quick Reference
+
+| Operation | Before | After |
+|-----------|--------|-------|
+| **Create** | `MultiMintWallet::new(localstore, seed, unit)` | `WalletRepositoryBuilder::new().localstore(localstore).seed(seed).build()` |
+| **Add Mint** | `wallet.add_mint(mint_url)` | `wallet.add_wallet(mint_url)` |
+| **Get Wallet** | N/A (methods took mint_url) | `wallet.get_wallet(&mint_url, &unit)` |
+| **Mint Quote** | `wallet.mint_quote(&mint_url, method, amount, ...)` | `wallet.get_wallet(&mint_url, &unit)?.mint_quote(method, amount, ...)` |
+| **Balances** | `HashMap<MintUrl, Amount>` | `BTreeMap<WalletKey, Amount>` |
+| **Total** | `Amount` | `BTreeMap<CurrencyUnit, Amount>` |
+
+## Detailed Changes
+
+### 1. Construction
+
+```rust
+// Before
+let wallet = MultiMintWallet::new(localstore, seed, CurrencyUnit::Sat).await?;
+
+// After
+let wallet = WalletRepositoryBuilder::new()
+    .localstore(localstore)
+    .seed(seed)
+    .build()
+    .await?;
+```
+
+### 2. Adding Mints
+
+```rust
+// Before
+wallet.add_mint(mint_url.clone()).await?;
+
+// After - creates wallets for ALL supported units
+wallet.add_wallet(mint_url.clone()).await?;
+
+// Or create specific wallet with config
+let config = WalletConfig::new()
+    .with_target_proof_count(5)
+    .with_metadata_cache_ttl(Some(Duration::from_secs(3600)));
+    
+let mint_wallet = wallet
+    .create_wallet(mint_url.clone(), CurrencyUnit::Sat, Some(config))
+    .await?;
+```
+
+### 3. Method Calls (Get Wallet First)
+
+All methods that previously took `mint_url` now require getting the wallet first:
+
+```rust
+// Before
+let quote = wallet
+    .mint_quote(&mint_url, PaymentMethod::BOLT11, Some(amount), None, None)
+    .await?;
+
+// After
+let mint_wallet = wallet.get_wallet(&mint_url, &CurrencyUnit::Sat).await?;
+let quote = mint_wallet
+    .mint_quote(PaymentMethod::BOLT11, Some(amount), None, None)
+    .await?;
+```
+
+This pattern applies to all wallet operations:
+- `mint_quote()` → get wallet → `mint_wallet.mint_quote()`
+- `wait_for_mint_quote()` → get wallet → `mint_wallet.wait_and_mint_quote()`
+- `melt_quote()` → get wallet → `mint_wallet.melt_quote()`
+- `prepare_melt()` → get wallet → `mint_wallet.prepare_melt()`
+- `prepare_send()` → get wallet → `mint_wallet.prepare_send()`
+- `receive()` → get wallet → `mint_wallet.receive()`
+- `swap()` → get wallet → `mint_wallet.swap()`
+- `restore()` → get wallet → `mint_wallet.restore()`
+- `mint_tokens()` → get wallet → `mint_wallet.mint()` (renamed)
+
+### 4. wait_and_mint_quote Signature Change
+
+Note: `wait_and_mint_quote` now takes the full `MintQuote` instead of just the quote ID:
+
+```rust
+// Before
+let proofs = wallet
+    .wait_for_mint_quote(&mint_url, &quote_id, split_target, conditions, timeout)
+    .await?;
+
+// After - pass the full MintQuote
+let proofs = mint_wallet
+    .wait_and_mint_quote(quote, split_target, conditions, timeout)
+    .await?;
+```
+
+### 5. Balance Handling
+
+```rust
+// Before - single amount
+let total = wallet.total_balance().await?;
+
+// After - by currency unit
+let balances = wallet.total_balance().await?;
+let sat_total = balances
+    .get(&CurrencyUnit::Sat)
+    .copied()
+    .unwrap_or(Amount::ZERO);
+```
+
+```rust
+// Before - HashMap<MintUrl, Amount>
+let balances: HashMap<MintUrl, Amount> = wallet.get_balances().await?;
+for (mint_url, balance) in balances {
+    println!("{}: {}", mint_url, balance);
+}
+
+// After - BTreeMap<WalletKey, Amount> (includes unit)
+let balances: BTreeMap<WalletKey, Amount> = wallet.get_balances().await?;
+for (key, balance) in balances {
+    println!("{} ({}): {}", key.mint_url, key.unit, balance);
+}
+```
+
+### 5. Receiving Tokens
+
+```rust
+// Before
+let received = wallet.receive(&token_str, MultiMintReceiveOptions::default()).await?;
+
+// After
+let token = Token::from_str(&token_str)?;
+let token_data = wallet.get_token_data(&token).await?;
+let mint_wallet = wallet
+    .get_wallet(&token_data.mint_url, &token_data.unit)
+    .await?;
+let received = mint_wallet.receive(&token_str, ReceiveOptions::default()).await?;
+```
+
+## API Changes
+
+### Removed from MultiMintWallet
+
+All methods moved to `Wallet` (get wallet first, then call):
+
+| Method | Change |
+|--------|--------|
+| `mint_quote(mint_url, ...)` | → `Wallet::mint_quote(...)` |
+| `wait_for_mint_quote(mint_url, ...)` | → `Wallet::wait_and_mint_quote(...)` |
+| `melt_quote(mint_url, ...)` | → `Wallet::melt_quote(...)` |
+| `prepare_melt(mint_url, ...)` | → `Wallet::prepare_melt(...)` |
+| `prepare_send(mint_url, ...)` | → `Wallet::prepare_send(...)` |
+| `receive(...)` | → `Wallet::receive(...)` |
+| `restore(mint_url)` | → `Wallet::restore()` |
+| `swap(mint_url, ...)` | → `Wallet::swap(...)` |
+| `mint_tokens(mint_url, ...)` | → `Wallet::mint(...)` |
+| `melt_quote(mint_url, ...)` | → `Wallet::melt_quote(PaymentMethod, bolt11_invoice, ...)` |
+| `add_mint(mint_url)` | → `WalletRepository::add_wallet(mint_url)` |
+| `add_mint_with_config(...)` | → `WalletRepository::add_wallet_with_config(...)` |
+
+### New WalletRepository Methods
+
+```rust
+impl WalletRepository {
+    // Get specific wallet
+    async fn get_wallet(&self, mint_url: &MintUrl, unit: &CurrencyUnit) -> Result<Wallet>;
+    
+    // Get all wallets for a mint
+    async fn get_wallets_for_mint(&self, mint_url: &MintUrl) -> Vec<Wallet>;
+    
+    // Check existence
+    async fn has_wallet(&self, mint_url: &MintUrl, unit: &CurrencyUnit) -> bool;
+    async fn has_mint(&self, mint_url: &MintUrl) -> bool;
+    
+    // Create with config
+    async fn create_wallet(&self, mint_url: MintUrl, unit: CurrencyUnit, config: Option<WalletConfig>) -> Result<Wallet>;
+    async fn set_mint_config(&self, mint_url: MintUrl, unit: CurrencyUnit, config: WalletConfig) -> Result<Wallet>;
+    
+    // Remove
+    async fn remove_wallet(&self, mint_url: MintUrl, unit: CurrencyUnit) -> Result<()>;
+    
+    // Helpers
+    async fn get_token_data(&self, token: &Token) -> Result<TokenData>;
+    async fn check_all_mint_quotes(&self, mint_url: Option<MintUrl>) -> Result<Amount>;
+}
+```
+
+### Type Changes
+
+| Old | New |
+|-----|-----|
+| `MultiMintWallet` | `WalletRepository` |
+| `MultiMintReceiveOptions` | `ReceiveOptions` |
+| `HashMap<MintUrl, Amount>` (balances) | `BTreeMap<WalletKey, Amount>` |
+| `Amount` (total_balance) | `BTreeMap<CurrencyUnit, Amount>` |
+
+## Melt Saga Changes
+
+Melt operations now use the saga pattern with type-state safety and support for async completion. The API requires calling `melt_quote` first to create a quote, then `prepare_melt` with the quote ID.
+
+### Basic Melt Flow
+
+```rust
+// Before: prepare_melt returned a result that completed immediately
+let prepared = wallet.prepare_melt(&quote_id, HashMap::new()).await?;
+let result = prepared.confirm().await?;
+```
+
+```rust
+// After: Two-step process - melt_quote then prepare_melt
+use cdk::nuts::PaymentMethod;
+use cdk::wallet::MeltOutcome;
+
+// Step 1: Create a melt quote
+let melt_quote = wallet
+    .melt_quote(PaymentMethod::BOLT11, invoice, None, None)
+    .await?;
+
+// Step 2: Prepare the melt with the quote ID
+let prepared = wallet
+    .prepare_melt(&melt_quote.id, std::collections::HashMap::new())
+    .await?;
+
+// Step 3: Confirm and handle the outcome
+match prepared.confirm().await? {
+    MeltOutcome::Paid(melted) => {
+        println!("Paid! Amount: {}, Fee: {}", melted.amount(), melted.fee_paid());
+    }
+    MeltOutcome::Pending(pending) => {
+        // Melt is processing asynchronously
+        // Can await immediately or drop for background completion
+        let melted = pending.await?;
+        println!("Completed! Amount: {}, Fee: {}", melted.amount(), melted.fee_paid());
+    }
+}
+
+// Option: Prefer async (returns Pending immediately if supported)
+let outcome = prepared.confirm_prefer_async().await?;
+// Handle same as above
+```
+
+### New PreparedMelt Methods
+
+```rust
+impl PreparedMelt {
+    /// Confirm the melt (waits for immediate completion or returns Pending)
+    async fn confirm(self) -> Result<MeltOutcome, Error>;
+    
+    /// Confirm with options (e.g., skip_swap)
+    async fn confirm_with_options(self, options: MeltConfirmOptions) -> Result<MeltOutcome, Error>;
+    
+    /// Prefer async completion
+    async fn confirm_prefer_async(self) -> Result<MeltOutcome, Error>;
+    
+    /// Cancel the prepared melt (releases reserved proofs)
+    async fn cancel(self) -> Result<(), Error>;
+}
+```
+
+### MeltConfirmOptions
+
+```rust
+let options = MeltConfirmOptions::default()
+    .skip_swap(true); // Skip swap before melt if needed
+
+let outcome = prepared.confirm_with_options(options).await?;
+```
+
+### Handling Pending Melts
+
+```rust
+use cdk::wallet::MeltOutcome;
+
+// Immediate await
+if let MeltOutcome::Pending(pending) = outcome {
+    let melted = pending.await?;
+}
+
+// Or drop for background completion via WebSocket or finalize_pending_melts()
+drop(pending); // Will complete via notifications
+
+// Later: recover pending melts after restart
+wallet.finalize_pending_melts().await?;
+```
+
+### Recovery
+
+```rust
+// Recover incomplete sagas on startup
+wallet.recover_incomplete_sagas().await?;
+```
+
+## FFI Changes
+
+FFI bindings follow the same pattern:
+
+```swift
+// Before
+let wallet = MultiMintWallet(mnemonic: mnemonic, database: db)
+let quote = try await wallet.mintQuote(mintUrl: mintUrl, ...)
+
+// After
+let wallet = WalletRepository(mnemonic: mnemonic, database: db)
+try await wallet.addMint(mintUrl: mintUrl, unit: .sat, targetProofCount: 3)
+let mintWallet = try await wallet.getWallet(mintUrl: mintUrl, unit: .sat)
+let quote = try await mintWallet.mintQuote(...)
+```
+
+Same pattern applies to Kotlin and Python - `MultiMintWallet` → `WalletRepository`, get `Wallet` first, then call methods.
+
+## Troubleshooting
+
+### "no method named `mint_quote` found for struct `WalletRepository`"
+
+**Cause:** Calling wallet method on repository instead of getting wallet first.
+
+**Fix:**
+```rust
+let mint_wallet = wallet.get_wallet(&mint_url, &CurrencyUnit::Sat).await?;
+let quote = mint_wallet.mint_quote(...).await?;
+```
+
+### "expected struct `Amount`, found struct `BTreeMap`"
+
+**Cause:** `total_balance()` now returns map.
+
+**Fix:**
+```rust
+let balances = wallet.total_balance().await?;
+let total = balances.get(&CurrencyUnit::Sat).copied().unwrap_or(Amount::ZERO);
+```
+
+### "cannot find type `MultiMintWallet`"
+
+**Fix:** Update imports:
+```rust
+use cdk::wallet::{WalletRepository, WalletRepositoryBuilder};
+```
+
+## References
+
+- [Changelog](../../CHANGELOG.md#0150)
+- [Issue #1577](https://github.com/cashubtc/cdk/issues/1577)

+ 2 - 2
flake.nix

@@ -130,7 +130,7 @@
         commonCraneArgs = {
           inherit src;
           pname = "cdk";
-          version = "0.14.0";
+          version = "0.15.0-rc.0";
 
           nativeBuildInputs = with pkgs; [
             pkg-config
@@ -213,7 +213,7 @@
         mkWasmBuild = name: cargoArgs: craneLib.cargoBuild ({
           inherit src;
           pname = "cdk-wasm-${name}";
-          version = "0.14.0";
+          version = "0.15.0-rc.0";
           cargoArtifacts = workspaceDeps;
           cargoExtraArgs = "${cargoArgs} --target wasm32-unknown-unknown";
           # WASM doesn't need native build inputs

+ 41 - 15
justfile

@@ -497,6 +497,8 @@ release m="":
     "-p cashu"
     "-p cdk-prometheus"
     "-p cdk-common"
+    "-p cdk-http-client"
+    "-p cdk-npubcash"
     "-p cdk-sql-common"
     "-p cdk-sqlite"
     "-p cdk-postgres"
@@ -530,31 +532,36 @@ release m="":
   echo "📦 Triggering Swift package release for version $VERSION..."
   just ffi-release-swift $VERSION
 
+  # Trigger Kotlin package release after Rust crates are published
+  echo "📦 Triggering Kotlin package release for version $VERSION..."
+  just ffi-release-kotlin $VERSION
+
 check-docs:
   #!/usr/bin/env bash
   set -euo pipefail
   args=(
     "-p cashu"
     "-p cdk-common"
+    "-p cdk-http-client"
+    "-p cdk-npubcash"
     "-p cdk-sql-common"
-    "-p cdk"
-    "-p cdk-redb"
     "-p cdk-sqlite"
     "-p cdk-postgres"
+    "-p cdk-redb"
+    "-p cdk-signatory"
+    "-p cdk-fake-wallet"
+    "-p cdk"
+    "-p cdk-ffi"
     "-p cdk-axum"
+    "-p cdk-mint-rpc"
     "-p cdk-cln"
     "-p cdk-lnd"
     "-p cdk-lnbits"
     "-p cdk-ldk-node"
-    "-p cdk-fake-wallet"
-    "-p cdk-mint-rpc"
-    "-p cdk-npubcash"
     "-p cdk-prometheus"
     "-p cdk-payment-processor"
-    "-p cdk-signatory"
     "-p cdk-cli"
     "-p cdk-mintd"
-    "-p cdk-ffi"
   )
 
   for arg in "${args[@]}"; do
@@ -570,25 +577,26 @@ docs-strict:
   args=(
     "-p cashu"
     "-p cdk-common"
+    "-p cdk-http-client"
+    "-p cdk-npubcash"
     "-p cdk-sql-common"
-    "-p cdk"
-    "-p cdk-redb"
     "-p cdk-sqlite"
     "-p cdk-postgres"
+    "-p cdk-redb"
+    "-p cdk-signatory"
+    "-p cdk-fake-wallet"
+    "-p cdk"
+    "-p cdk-ffi"
     "-p cdk-axum"
+    "-p cdk-mint-rpc"
     "-p cdk-cln"
     "-p cdk-lnd"
     "-p cdk-lnbits"
     "-p cdk-ldk-node"
-    "-p cdk-fake-wallet"
-    "-p cdk-mint-rpc"
-    "-p cdk-npubcash"
     "-p cdk-prometheus"
     "-p cdk-payment-processor"
-    "-p cdk-signatory"
     "-p cdk-cli"
     "-p cdk-mintd"
-    "-p cdk-ffi"
   )
 
   for arg in "${args[@]}"; do
@@ -748,4 +756,22 @@ ffi-release-swift VERSION:
     --field cdk_repo="cashubtc/cdk" \
     --field cdk_ref="v{{VERSION}}"
   
-  echo "✅ Workflow triggered successfully!"
+  echo "✅ Swift workflow triggered successfully!"
+
+# Trigger Kotlin Package release workflow
+ffi-release-kotlin VERSION:
+  #!/usr/bin/env bash
+  set -euo pipefail
+  
+  echo "🚀 Triggering Publish Kotlin Package workflow..."
+  echo "   Version: {{VERSION}}"
+  echo "   CDK Ref: v{{VERSION}}"
+  
+  # Trigger the workflow using GitHub CLI
+  gh workflow run "Publish Kotlin Package" \
+    --repo cashubtc/cdk-kotlin \
+    --field version="{{VERSION}}" \
+    --field cdk_repo="cashubtc/cdk" \
+    --field cdk_ref="v{{VERSION}}"
+  
+  echo "✅ Kotlin workflow triggered successfully!"