Commit Graph

43 Commits

Author SHA1 Message Date
Cesar Rodas
760564cee0 Introduce subscription support in the Wallet crate.
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
2024-12-08 16:25:00 +00:00
Timothée Delabrouille
7d87c4806c feat: use Uuid as mint and melt quote ids (#469) 2024-12-05 09:58:53 +00:00
César D. Rodas
7d15587e3f Minor improvement cache avoid clone (#479)
Avoid cloning to serialize to JSON; instead, dereference the object, as Serde
needs a reference to the object.
2024-11-30 14:57:12 +00:00
thesimplekid
d1b03d39c5 chore: update to 0.5.0 2024-11-19 09:55:46 +00:00
thesimplekid
6dd023a71c chore: cargo fmt 2024-11-15 19:38:59 +00:00
César D. Rodas
cc5b267367 fix: Send current state of the subscriptions (#444) 2024-11-10 12:08:44 +00:00
César D. Rodas
6973e53799 Mint Websockets (NUT-17) (#394)
---------

Co-authored-by: thesimplekid <tsk@thesimplekid.com>
2024-11-06 14:36:13 +00:00
Mubarak Muhammad Aminu
0164a8801c chore:change function name to reflect route action (#439)
* chore:change function name to reflect route action

* change mint function name to reflect route action
2024-11-05 21:24:25 +00:00
ok300
dffc30233c mintd: add utoipa swagger UI 2024-10-22 08:32:56 +02:00
thesimplekid
515991f8d2 fix: cache melt response 2024-10-06 07:53:13 +02:00
lollerfirst
c25bf79e8c Cache SwapResponse, MeltBolt11Response and MintBolt11Response (#361)
* added cache to mint state and post request wrapper macro.
---------

Co-authored-by: thesimplekid <tsk@thesimplekid.com>
2024-10-05 11:18:23 +02:00
thesimplekid
27eed93e3c feat: remove old nut05 response 2024-10-03 08:51:39 +02:00
thesimplekid
008c913583 refactor: ln backends within mint 2024-09-27 10:04:33 +02:00
thesimplekid
5139c47dac feat: check outgoing payment status flow 2024-09-25 20:28:05 +02:00
Pavol Rusnak
11fa39a003 chore: remove unused deps 2024-09-20 08:43:13 +02:00
thesimplekid
f9bb5eb913 feat: itests
fix: melt change promises amount
2024-09-19 11:43:43 +02:00
thesimplekid
725f59af04 fix: melt transaction balanced 2024-09-18 16:28:14 +02:00
thesimplekid
88b79eb9e9 fix: melt verify error response 2024-09-15 08:57:35 +01:00
thesimplekid
a4af725458 fix: router check melt status paid 2024-09-14 12:15:50 +01:00
thesimplekid
fba609f28a feat: add unit to PayInvoiceResponse 2024-09-14 11:25:58 +01:00
lollerfirst
7e860c71f2 NUT-04 Mint Quote Description (#337) 2024-09-12 12:27:52 +01:00
thesimplekid
3bf1a3b28f chore: version cdk in other crates 2024-09-08 22:12:06 +01:00
thesimplekid
f7e4ea3a6c Release 0.4.0 2024-09-08 21:48:51 +01:00
thesimplekid
9b78305722 refactor: calc fee 2024-09-08 13:34:54 +01:00
thesimplekid
2fdf48cc72 feat: remove mint and wallet errors 2024-09-08 11:48:52 +01:00
thesimplekid
1f81b24f40 feat: try_sum for amounts 2024-09-05 18:42:11 +01:00
Pavol Rusnak
e67dc15ce6 feat: implement nut-06 time 2024-09-03 17:00:57 +01:00
thesimplekid
1eb14703a5 refactor: cdk MSRV 2024-09-03 12:35:35 +01:00
thesimplekid
5f87df2cef refactor: use MintUrl::from_str 2024-09-03 11:36:28 +01:00
thesimplekid
847eab8e07 chore: fmt 2024-08-29 15:09:59 +01:00
thesimplekid
cc5efd9887 feat: phoenixd ln backend 2024-08-29 11:16:45 +01:00
thesimplekid
e8114f3383 feat(tests): integration test 2024-08-19 00:01:30 +02:00
thesimplekid
03e2b86022 feat: use amount type in ln 2024-08-13 15:39:38 +01:00
thesimplekid
bbd214899f feat: use expiry from created invoice 2024-08-13 12:36:05 +01:00
thesimplekid
e4069c0243 chore: use workspace version 2024-08-08 10:11:31 -04:00
thesimplekid
c36eb3caa2 refactor: clean up workspace deps 2024-07-27 08:33:10 -04:00
thesimplekid
169f5f1533 feat: strike multi unit
fix: mint create new keysets for units

fix: use amount from melt quote

fix: melt quote correct payment unit
2024-07-26 12:48:41 -04:00
thesimplekid
bc9fad9e0e feat: strike api for mint backend
feat: Use mint melt settings
2024-07-22 16:16:05 +01:00
thesimplekid
f9d8d5d147 chore: cargo metadata 2024-07-11 21:32:57 +01:00
thesimplekid
0d16b44884 feat: MintInfo and nuts builder 2024-07-07 22:48:01 +01:00
thesimplekid
8d0b8fb357 feat: multiple ln backends 2024-07-07 19:01:18 +01:00
thesimplekid
46f8689b1f feat: check if invoice already paid on melt
feat: check if internal invoice already settled
2024-07-07 11:14:40 +01:00
thesimplekid
6a315fc3b9 feat: mintd axum server
feat: deafult NUT-04 and NUT-05 settings to enable bolt11 sats
2024-07-05 23:49:31 +01:00