feat: expose subscribe_mint_quote_state to FFI bindings #1725

Merged
Forte11Cuba merged 2 commits from feat/expose-mint-quote-state-subscription into main 2026-03-17 18:01:55 +00:00
Forte11Cuba commented 2026-03-10 15:52:41 +00:00 (Migrated from github.com)

Description

Add subscribe_mint_quote_state(quote_ids, payment_method) convenience method to the FFI Wallet, allowing binding users (Swift/Kotlin) to subscribe to mint quote state updates without manually constructing SubscribeParams with the correct SubscriptionKind.

The method automatically maps PaymentMethod to the correct subscription kind (Bolt11 -> Bolt11MintQuote, Bolt12 -> Bolt12MintQuote) and returns an ActiveSubscription where recv() yields NotificationPayload::MintQuoteUpdate.


Notes to the reviewers

The generic subscribe() method was already exposed to FFI bindings. This adds a higher-level convenience specifically for mint quote subscriptions, which is the most common use case from mobile apps.
Custom payment methods return an error since SubscriptionKind in FFI doesn't have a Custom variant yet. Users can still use the generic subscribe() for those cases.
The second function mentioned in the issue ("a stream of updates") is already covered by ActiveSubscription.recv().


Suggested CHANGELOG Updates

CHANGED

ADDED

  • Added subscribe_mint_quote_state convenience method to FFI Wallet for subscribing to mint quote state updates from bindings (#1336)

REMOVED

FIXED


Checklist

### Description Add `subscribe_mint_quote_state(quote_ids, payment_method)` convenience method to the FFI Wallet, allowing binding users (Swift/Kotlin) to subscribe to mint quote state updates without manually constructing `SubscribeParams` with the correct `SubscriptionKind`. The method automatically maps `PaymentMethod` to the correct subscription kind (Bolt11 -> `Bolt11MintQuote`, Bolt12 -> `Bolt12MintQuote`) and returns an `ActiveSubscription` where `recv()` yields `NotificationPayload::MintQuoteUpdate`. ----- ### Notes to the reviewers The generic subscribe() method was already exposed to FFI bindings. This adds a higher-level convenience specifically for mint quote subscriptions, which is the most common use case from mobile apps. Custom payment methods return an error since SubscriptionKind in FFI doesn't have a Custom variant yet. Users can still use the generic subscribe() for those cases. The second function mentioned in the issue ("a stream of updates") is already covered by ActiveSubscription.recv(). ----- ### Suggested [CHANGELOG](https://github.com/cashubtc/cdk/blob/main/CHANGELOG.md) Updates #### CHANGED #### ADDED - Added subscribe_mint_quote_state convenience method to FFI Wallet for subscribing to mint quote state updates from bindings (#1336) #### REMOVED #### FIXED ---- ### Checklist * [x] I followed the [code style guidelines](https://github.com/cashubtc/cdk/blob/main/CODE_STYLE.md) * [x] I ran `just final-check` before committing
ye0man commented 2026-03-11 15:46:56 +00:00 (Migrated from github.com)

closes #1336

closes #1336
crodas (Migrated from github.com) approved these changes 2026-03-17 14:43:27 +00:00
thesimplekid (Migrated from github.com) approved these changes 2026-03-17 18:01:15 +00:00
Sign in to join this conversation.
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!1725
No description provided.