Add MultiMintWallet check and wait for mint quotes #1146

Merged
davidcaseria merged 2 commits from mmw-check-mint-quote into main 2025-10-02 11:24:36 +00:00
davidcaseria commented 2025-10-01 13:44:29 +00:00 (Migrated from github.com)

Description

This PR adds two new methods to the MultiMintWallet for better mint quote management:

  1. check_mint_quote - Checks the current state of a specific mint quote by querying the mint and updating the local storage. Returns the updated MintQuote with the latest state.

  2. wait_for_mint_quote - Waits for a mint quote to be paid (using subscriptions) and automatically mints the proofs once payment is confirmed. This provides a convenient single-operation method with configurable timeout and split target options.

Both methods are available in the core MultiMintWallet implementation and exposed through FFI bindings for use in language bindings (Swift, Kotlin, etc.).


Notes to the reviewers

  • The check_mint_quote implementation follows the same pattern as other quote-related methods in MultiMintWallet
  • The wait_for_mint_quote leverages the existing Wallet::wait_and_mint_quote method, which handles subscriptions and automatic minting
  • Both methods properly validate that the mint URL exists in the wallet and handle errors appropriately

Suggested CHANGELOG Updates

ADDED

  • MultiMintWallet::check_mint_quote - Check the state of a specific mint quote
  • MultiMintWallet::wait_for_mint_quote - Wait for a mint quote to be paid and automatically mint proofs

Checklist

### Description This PR adds two new methods to the `MultiMintWallet` for better mint quote management: 1. **`check_mint_quote`** - Checks the current state of a specific mint quote by querying the mint and updating the local storage. Returns the updated `MintQuote` with the latest state. 2. **`wait_for_mint_quote`** - Waits for a mint quote to be paid (using subscriptions) and automatically mints the proofs once payment is confirmed. This provides a convenient single-operation method with configurable timeout and split target options. Both methods are available in the core `MultiMintWallet` implementation and exposed through FFI bindings for use in language bindings (Swift, Kotlin, etc.). ----- ### Notes to the reviewers - The `check_mint_quote` implementation follows the same pattern as other quote-related methods in `MultiMintWallet` - The `wait_for_mint_quote` leverages the existing `Wallet::wait_and_mint_quote` method, which handles subscriptions and automatic minting - Both methods properly validate that the mint URL exists in the wallet and handle errors appropriately ----- ### Suggested [CHANGELOG](https://github.com/cashubtc/cdk/blob/main/CHANGELOG.md) Updates #### ADDED - `MultiMintWallet::check_mint_quote` - Check the state of a specific mint quote - `MultiMintWallet::wait_for_mint_quote` - Wait for a mint quote to be paid and automatically mint proofs ---- ### Checklist * [ ] I followed the [code style guidelines](https://github.com/cashubtc/cdk/blob/main/CODE_STYLE.md) * [ ] I ran `just final-check` before committing
thesimplekid (Migrated from github.com) approved these changes 2025-10-02 11:24:27 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cashubtc/cdk!1146
No description provided.