MCPcopy Create free account
hub / github.com/ElementsProject/lightning / account_balance

Function account_balance

tests/utils.py:182–191  ·  view source on GitHub ↗
(n, account_id)

Source from the content-addressed store, hash-verified

180
181
182def account_balance(n, account_id):
183 moves = dedupe_moves(n.rpc.call('listcoinmoves_plugin')['coin_moves'])
184 chan_moves = [m for m in moves if m['account_id'] == account_id]
185 if len(chan_moves) == 0:
186 raise ValueError(f"No channel moves found for {account_id}. {moves}")
187 m_sum = Millisatoshi(0)
188 for m in chan_moves:
189 m_sum += Millisatoshi(m['credit_msat'])
190 m_sum -= Millisatoshi(m['debit_msat'])
191 return m_sum
192
193
194def extract_utxos(moves):

Callers 15

test_funding_pushFunction · 0.90
test_withdraw_miscFunction · 0.90
test_closing_simpleFunction · 0.90
test_penalty_inhtlcFunction · 0.90
test_penalty_outhtlcFunction · 0.90
test_penalty_rbf_normalFunction · 0.90
test_onchain_unwatchFunction · 0.90
test_onchain_dust_outFunction · 0.90

Calls 3

MillisatoshiClass · 0.90
dedupe_movesFunction · 0.85
callMethod · 0.45

Tested by 15

test_funding_pushFunction · 0.72
test_withdraw_miscFunction · 0.72
test_closing_simpleFunction · 0.72
test_penalty_inhtlcFunction · 0.72
test_penalty_outhtlcFunction · 0.72
test_penalty_rbf_normalFunction · 0.72
test_onchain_unwatchFunction · 0.72
test_onchain_dust_outFunction · 0.72