The main goal is to add a subscription to CDK Mint updates into the wallet.
This feature will be particularly useful for improving the code whenever loops
hit the mint server to check status changes.
The goal is to add an easy-to-use interface that will hide the fact that we're
connecting to WebSocket and subscribing to events. This will also hide the fact
that the CDK-mint server may not support WebSocket updates.
To be fully backward compatible, the HttpClientMethods traits have a new
method, `subscribe,` which will return an object that implements
`ActiveSubscription.`
In the primary implementation, there is a `SubscriptionClient` that will
attempt to connect through WebSocket and will fall to the HTTP-status pull and
sleep approach (the current approach), but upper stream code will receive
updates as if they come from a stream of updates through WebSocket. This
`SubscriptionClient` struct will also manage reconnections to WebSockets (with
automatic resubscriptions) and all the low-level stuff, providing an
easy-to-use interface and leaving the upper-level code with a nice interface
that is hard to misuse. When `ActiveSubscription` is dropped, it will
automatically unsubscribe.
Fixed bug with Default as described in https://github.com/cashubtc/cdk/pull/473#discussion_r1871032297
This is a minor improvement over the SQLite crate, which performs fewer SQL
statements and fetches multiple results instead.
This will also remove some redundant commit() and rollback calls. Rollback
already happens on drop, and there is no need for a commit if the database
hasn't changed, as the transaction is used as a locking mechanism in this
context.
* fix: return u32 from existing Id::TryFrom and add lossless u64 versions
* remove TryFrom<u64> for Id and it's inverse
* fix: remove unit test and fix nut13::derive_path_from_keyset_id
* test: derive_path_from_keyset_id
* fix: convert Id::TryFrom to Id::From
* docs: comment calling out From<Id> for u32 as a one-way function