Commit Graph

882 Commits

Author SHA1 Message Date
thesimplekid
27636c86b7 chore: zip version (#668)
* chore: zip version
2025-03-23 21:18:02 +00:00
thesimplekid
e3570c3e98 Wallet dleq (#667)
* feat: Add DLEQ proofs to sqlite db
2025-03-23 17:32:29 +00:00
thesimplekid
c48b5202f0 refactor: move Mint and Melt quote to cdk common 2025-03-22 17:04:46 +00:00
David Caseria
24a9446581 Fix protoc build error 2025-03-20 14:59:14 -04:00
David Caseria
db1db86509 Prepared Send (#596)
Co-authored-by: thesimplekid <tsk@thesimplekid.com>
Co-authored-by: ok300 <106775972+ok300@users.noreply.github.com>
2025-03-20 11:44:44 +00:00
ok300
558024d7fe Ser/Deserialize SecretKey either as bytes or string 2025-03-19 12:34:23 +01:00
thesimplekid
0155962d11 Update crates/cashu/src/nuts/nut18.rs
Co-authored-by: ok300 <106775972+ok300@users.noreply.github.com>
2025-03-13 14:46:22 +00:00
thesimplekid
be1e048f2c Update crates/cashu/src/nuts/nut18.rs
Co-authored-by: ok300 <106775972+ok300@users.noreply.github.com>
2025-03-13 14:46:15 +00:00
thesimplekid
eb5899843a feat: export transport type 2025-03-13 14:14:56 +00:00
thesimplekid (aider)
32ded596cd feat: payments request builder 2025-03-13 14:09:14 +00:00
thesimplekid
cf9cacaff4 fix: verification of melt quote with empty outputs 2025-03-13 09:55:17 +00:00
thesimplekid
8d1b35f52e fix: Improve spending conditions validation in ProofInfo 2025-03-12 20:51:03 +00:00
ok300
72dff95322 Merge pull request #653 from ok300/ok300-fix-update-mint-url
Wallet: fix `update_mint_url`
2025-03-11 18:41:52 +00:00
ok300
3ba3449c81 Integration tests: fix wait_for_mint_to_be_paid loop 2025-03-11 12:18:24 +01:00
benthecarman
8cd4ea301a chore: Update sqlx to 0.7.4 2025-03-10 19:01:57 -05:00
thesimplekid
a691df7916 Merge pull request #650 from benthecarman/rm-clone
fix: remove unnecessary clone
2025-03-10 16:31:55 +00:00
benthecarman
080f4ef2bf fix: remove unnecessary clone 2025-03-10 11:07:19 -05:00
thesimplekid
3bf908d89d Merge pull request #648 from TechVest/main
chore: remove redundant words in comment
2025-03-10 15:30:49 +00:00
thesimplekid
162507c492 feat: payment processor 2025-03-10 14:44:57 +00:00
TechVest
c5284b889f chore: remove redundant words in comment
Signed-off-by: TechVest <techdashen@qq.com>
2025-03-10 22:33:22 +08:00
ok300
1131711d91 Drop nostr_last_checked table, remove references (#647)
* cdk-sqlite: Drop unused table nostr_last_checked

* cdk-rexie: Drop unused object store nostr_last_checked

* cdk-redb: Remove unused table ref nostr_last_checked
2025-03-10 13:37:20 +00:00
thesimplekid (aider)
cb87fefacd refactor: Remove nostr last checked methods from database trait and implementations 2025-03-09 23:11:02 +00:00
benthecarman
40c53e83df feat: Add support for sqlcipher 2025-03-09 15:08:43 -05:00
thesimplekid
b787951dbc feat: Add feature gates for CLN, LND, fakewallet and LNbits backends (#638)
* feat: Add feature gates for CLN, LND, fakewallet and LNbits backends
2025-03-09 14:18:19 +00:00
thesimplekid
93f7979a70 refactor: remove unused ln_backends in cdk-mintd 2025-03-09 09:46:37 +00:00
thesimplekid
467cc0a027 feat: Add migration for keyset_id as foreign key in SQLite database (#634) 2025-03-08 22:46:12 +00:00
thesimplekid
39a7b15221 Check tls certs exist for grpc management serve (#637)
* feat: Add TLS directory existence check before starting RPC server

* feat: Add file existence checks with detailed error logging for TLS files

* chore: fmt
2025-03-08 22:44:46 +00:00
thesimplekid
22beade553 Amount and unit nut04/05 (#635)
* feat: return amount and unit in mint response


Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
2025-03-08 22:41:21 +00:00
thesimplekid
b7380dc858 feat: Add tos_url to mintd config (#636)
* feat: Add tos_url to mintd config

* docs: tos in change log
2025-03-07 21:06:22 +00:00
NodlAndHodl
fcf2e9d603 feat: adding tos to mint (#604)
* feat: adding tos(terms of service) to mint and update cdk-sqlite migration
2025-03-07 20:29:10 +00:00
ok300
5a7362c09f Simplify process_swap_request (#631)
* Simplify process_swap_request

* Fix occasional test_swap_to_send wallet errors
2025-03-06 15:08:59 +00:00
thesimplekid
393c95e115 Merge pull request #630 from thesimplekid/db_check_on_delete_proofs
Db check on delete proofs
2025-03-06 09:41:40 +00:00
thesimplekid (aider)
d41d3a7c94 refactor: Add state check before deleting proofs to prevent removing spent proofs 2025-03-06 09:23:40 +00:00
ok300
813794353a Add ensure_cdk macro 2025-03-05 17:39:08 +01:00
thesimplekid
f5be0ceeb6 chore: remove phd 2025-03-05 11:04:05 +00:00
thesimplekid
e84d6ea7ab chore: Update rust-version (MSRV) to 1.75.0 (#623) 2025-03-05 10:32:41 +00:00
C
f7d9a1b5db Drop the in-memory database (#613)
* Drop the in-memory database

Fixes #607

This PR drops the implementation of in-memory database traits.

They are useful for testing purposes since the tests should test our codebase
and assume the database works as expected (although a follow-up PR should write
a sanity test suite for all database trait implementors).

As complexity is worth with database requirements to simplify complexity and
add more robustness, for instance, with the following plans to add support for
transactions or buffered writes, it would become more complex and
time-consuming to support a correct database trait. This PR drops the
implementation and replaces it with a SQLite memory instance

* Remove OnceCell<Mint>

Without this change, a single Mint is shared for all tests, and the first tests
to run and shutdown makes the other databases (not-reachable, as dropping the
tokio engine would also drop the database instance).

There is no real reason, other than perhaps performance. The mint should
perhaps run in their own tokio engine and share channels as API interfaces, or
a new instance should be created in each tests

* Fixed bug with foreign keys

[1] https://gist.github.com/crodas/bad00997c63bd5ac58db3c5bd90747ed

* Show more debug on failure

* Remove old code

* Remove old references to WalletMemoryDatabase
2025-03-04 19:44:34 +00:00
thesimplekid
d615897ef0 chore: improve logging in verification 2025-03-04 12:02:05 +00:00
thesimplekid
a82e3eb314 fix: attempt to swap after a failed transaction (#622)
* fix: attempt to swap after a failed transaction

* fix: revert test change in https://github.com/cashubtc/cdk/pull/585
2025-03-03 14:10:47 +00:00
C
63393056a0 Do not use INSERT OR REPLACE in SQLite. (#620)
Instead, use `INSERT` and `ON CONFLICT`.  The reason is that in case of
conflicts, the `REPLACE` will trigger a DELETE and then perform an INSERT, as
outlined in the documentation[1], and that may cause a cascade of deletion due
to our FOREIGN KEYs.

Here is the official documentation:

```
When a UNIQUE or PRIMARY KEY constraint violation occurs, the REPLACE algorithm
deletes pre-existing rows that are causing the constraint violation prior to
inserting or updating the current row and the command continues executing
normally. If a NOT NULL constraint violation occurs, the REPLACE conflict
resolution replaces the NULL value with the default value for that column, or
if the column has no default value, then the ABORT algorithm is used. If
a CHECK constraint or foreign key constraint violation occurs, the REPLACE
conflict resolution algorithm works like ABORT.  When the REPLACE conflict
resolution strategy deletes rows in order to satisfy a constraint, delete
triggers fire if and only if recursive triggers are enabled.  The update
hook is not invoked for rows that are deleted by the REPLACE conflict
resolution strategy. Nor does REPLACE increment the change counter. The
exceptional behaviors defined in this paragraph might change in a future
release.
```

[1] https://www.sqlite.org/lang_conflict.html
2025-02-28 11:35:29 +00:00
thesimplekid
062d7be58f chore: pin base64ct as newer version is unsuported on stable 2025-02-26 10:57:15 +00:00
thesimplekid
827e4aebde Refactor mintd used in itest (#616) 2025-02-25 11:47:17 +00:00
lollerfirst
692e13ff16 Refactor Keyset Initialization (#615)
* reorg keyset startup initialization
2025-02-24 15:16:50 +00:00
C
d5df413d6b Drop AmountStr (#612)
* Drop AmountStr

Fixes #609

Instead write a customer serializer for Keys to serialize amounts as strings

* Add a custom error for invalid amounts
2025-02-22 17:46:02 +00:00
codingpeanut157
606385f44a fix openApi attributes to keyset id to present it as a string
The attribute `schema(as = String)` does not result in the expected
behaviour.
It does not convert Id to being represented as a simple string, but
rather simply rename the type `Id` to `String`.

This commit removes the attribute that implements utoipa::ToSchema trait
for type `Id` and adds attribute to all the types that have a keyset id
    as inner type to represent it as string.
2025-02-20 16:27:43 +01:00
thesimplekid
e1458b07a8 chore: cdk-mintd v0.7.2 2025-02-13 11:50:07 +00:00
thesimplekid
a880e15d4c Merge pull request #603 from ok300/ok300-fix-mint-startup-clean-db-no-rpc
Fix minting and melting error on fresh `mintd` with RPC disabled
2025-02-13 11:47:23 +00:00
ok300
96003f3979 Fix minting and melting on mintd with RPC disabled 2025-02-13 12:34:50 +01:00
thesimplekid
7b7def17ee chore: release v0.7.1 2025-02-13 10:44:09 +00:00
thesimplekid
d6566f573b fix: cln return error on stream 2025-02-13 10:17:00 +00:00