Describe the bug
Currently, the Balance type returned by get_balance() only uses non-descript u64s, while not even stating a denomination anywhere in the documentation (I assume it's sats?). To avoid any confusion and make this much less error prone BDK should reuse the Amount type provided by rust-bitcoin.
Also, the documentation could generally be improved, e.g., clarifying what exactly it means that some funds are immature/trusted_pending/untrusted_pending/confirmed.
To Reproduce
Call Wallet::get_balance().
Expected behavior
Receive a meaningful return value.
Additional context
This is in particular confusing since similar u64 values are used in the Lightning space very often to denominate millisatoshis. It's best practice to append _msat to the names of such variables, which however still doesn't make use of the type system to avoid any conversion errors (we can't, as Amount doesn't allow to express millisatoshis). As BDK doesn't have to deal with millisatoshis, it really should make use of Amount here.
Describe the bug
Currently, the
Balancetype returned byget_balance()only uses non-descriptu64s, while not even stating a denomination anywhere in the documentation (I assume it's sats?). To avoid any confusion and make this much less error prone BDK should reuse theAmounttype provided byrust-bitcoin.Also, the documentation could generally be improved, e.g., clarifying what exactly it means that some funds are
immature/trusted_pending/untrusted_pending/confirmed.To Reproduce
Call
Wallet::get_balance().Expected behavior
Receive a meaningful return value.
Additional context
This is in particular confusing since similar
u64values are used in the Lightning space very often to denominate millisatoshis. It's best practice to append_msatto the names of such variables, which however still doesn't make use of the type system to avoid any conversion errors (we can't, asAmountdoesn't allow to express millisatoshis). As BDK doesn't have to deal with millisatoshis, it really should make use ofAmounthere.