Actually rust-bitcoin has both Amount and SignedAmount!
But yeah, same logic would apply to cdk's Amount wrapper too.
Thanks, Peter! I didn't know you were a rust dev. 🦀
I think you are referring to the SignedAmount type in bitcoin-rust: https://github.com/rust-bitcoin/rust-bitcoin/blob/master/units/src/amount/signed.rs#L84
cdk defines it's own amount type: https://github.com/cashubtc/cdk/blob/main/crates/cashu/src/amount.rs#L32
This `Amount` is independent of the `CurrencyUnit` type so you can use it for bitcoin, stablecoins, beefbux or whatever. I'm using it to track difficulty of mining shares.
Actually rust-bitcoin has both Amount and SignedAmount!
But yeah, same logic would apply to cdk's Amount wrapper too.
No replies yet.