Files
cdk/crates/cdk-common
vnprc 1a493d61f8 feat: optimize SQL balance calculation (#1152)
* feat: optimize SQL balance calculation

replace proof-fetching approach with SUM aggregation

- add get_balance() method to Database trait
- implement SQL SUM aggregation in cdk-sql-common
- update total_balance() to use get_balance() instead of get_unspent_proofs()
- redb impl maintains existing behavior

---------

Co-authored-by: thesimplekid <tsk@thesimplekid.com>
Co-authored-by: Cesar Rodas <cesar@rodasm.com.py>
2025-10-06 10:29:57 +02:00
..
2025-05-29 09:38:10 -04:00

CDK Common

crates.io Documentation MIT licensed

ALPHA This library is in early development, the API will change and should be used with caution.

Common types and utilities shared across the Cashu Development Kit (CDK) crates.

Installation

Add this to your Cargo.toml:

[dependencies]
cdk-common = "*"

Features

This crate provides common functionality used across CDK crates including:

  • Common data types and structures
  • Shared traits and interfaces
  • Utility functions
  • Error types

License

This project is licensed under the MIT License.