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 {
32
32
[Throws=NodeError]
33
33
Txid send_all_to_onchain_address([ByRef]Address address);
34
34
[Throws=NodeError]
35
+ u64 spendable_onchain_balance_sats();
36
+ [Throws=NodeError]
37
+ u64 total_onchain_balance_sats();
38
+ [Throws=NodeError]
35
39
void connect(PublicKey node_id, SocketAddr address, boolean permanently);
36
40
[Throws=NodeError]
37
41
void disconnect([ByRef]PublicKey node_id);
Original file line number Diff line number Diff line change @@ -891,6 +891,16 @@ impl Node {
891
891
self . wallet . send_to_address ( address, None )
892
892
}
893
893
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
+
894
904
/// Retrieve a list of known channels.
895
905
pub fn list_channels ( & self ) -> Vec < ChannelDetails > {
896
906
self . channel_manager . list_channels ( )
You can’t perform that action at this time.
0 commit comments