File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,10 @@ interface Node {
3232 [Throws=NodeError]
3333 Txid send_all_to_onchain_address([ByRef]Address address);
3434 [Throws=NodeError]
35+ u64 spendable_onchain_balance_sats();
36+ [Throws=NodeError]
37+ u64 total_onchain_balance_sats();
38+ [Throws=NodeError]
3539 void connect(PublicKey node_id, SocketAddr address, boolean permanently);
3640 [Throws=NodeError]
3741 void disconnect([ByRef]PublicKey node_id);
Original file line number Diff line number Diff line change @@ -891,6 +891,16 @@ impl Node {
891891 self . wallet . send_to_address ( address, None )
892892 }
893893
894+ /// Retrieve the currently spendable on-chain balance in satoshis.
895+ pub fn spendable_onchain_balance_sats ( & self ) -> Result < u64 , Error > {
896+ Ok ( self . wallet . get_balance ( ) . map ( |bal| bal. get_spendable ( ) ) ?)
897+ }
898+
899+ /// Retrieve the current total on-chain balance in satoshis.
900+ pub fn total_onchain_balance_sats ( & self ) -> Result < u64 , Error > {
901+ Ok ( self . wallet . get_balance ( ) . map ( |bal| bal. get_total ( ) ) ?)
902+ }
903+
894904 /// Retrieve a list of known channels.
895905 pub fn list_channels ( & self ) -> Vec < ChannelDetails > {
896906 self . channel_manager . list_channels ( )
You can’t perform that action at this time.
0 commit comments