- Replaced unwrap() calls with proper error handling using `?` operator.
- Added comments for better code understanding.
- Introduced a timeout mechanism to prevent infinite loops when checking the quote state.
- Ensured the main function returns a Result type for graceful error handling.
- Added descriptive comments to explain the functionality of each section in the code.
- Replaced unwrap() calls with proper error handling using `?` operator.
- Added comments for better code understanding.
- Managed the subscription mechanism properly to avoid potential issues with concurrent message handling.
- Ensured the main function returns a Result type for graceful error handling.
- Added descriptive comments to explain the functionality of each section in the code.
- Replaced unwrap() calls with proper error handling using `?` operator.
- Added comments for better code understanding.
- Managed the subscription mechanism properly to avoid potential issues with concurrent message handling.
- Ensured the main function returns a Result type for graceful error handling.
- Replaced unwrap() calls with proper error handling using `?` operator.
- Added comments for better code understanding.
- Managed the subscription mechanism properly to avoid potential issues with concurrent message handling.
- Ensured the main function returns a Result type for graceful error handling.
* Add ArcSwap to update Mint configuration at runtime
The main goal is to change settings without having multiple RwLock everywhere,
instead having ArcSwap to update the configuration without having access to a
mutable reference to the Mint.
This will allow the RPC Server, or any other medium to update the Mint without
minimum contention.
* Rename structs
* Move quote_ttl to the new config
* Fixed clippy issues
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