orb.misc.channel module

class orb.misc.channel.Channel(channel, *args, **kwargs)

Bases: EventDispatcher

This class intends to host all channel related data in Kivy properties, including channel policies.

This means the class object should not be replaced, as other objects in memory should be allowed to refer to it.

Instead the properties should be modified when the channel’s internal state changes.

active

Whether the channel is active or not

property alias
as_dict()
balanced_ratio

Balanced ratio, i.e the ratio at which the channel needs to be for the node to be balanced

capacity

The channel’s chapacity in satoshis

chan_id

The channel’s chan_id

channel_point

The channel’s channel_point

commit_fee

The channel’s commit_fee

property debt
property earned
fee_base_msat

the fee_base_msat as a NumericProperty

fee_rate_milli_msat

the fee_rate_milli_msat as a NumericProperty

get_policies()

Get the channel policies from LND, and bind them to update_lnd_with_policies. This means whenever a fee policy is changed in Orb, it immediately gets updated in LND.

property helped_earn
initiator

Whether we are the initiator

local_balance

The channel’s local_balance in sats

property local_balance_include_pending

Get the channel’s local balance, plus its pending outgoing HTLCs. This is because the local balance does not including the pending HTLCs, which means the local balance changes based on HTLC activity. This may not always be desireable.

max_htlc_msat

the max_htlc_msat as a NumericProperty

min_htlc_msat

the min_htlc as a NumericProperty

pending_htlcs

The channel’s pending_htlcs

property pending_in
property pending_in_htlc_ids
property pending_out
property pending_out_htlc_ids
property profit

Channel profit is how much the channel made in fees minus how much was spent rebalancing towards it.

property ratio

Get the channels’s ratio

property ratio_include_pending

Get the channels’s ratio

remote_balance

The channel’s remote_balance in sats

property remote_balance_include_pending
remote_pubkey

The channel’s remote_pubkey

time_lock_delta

the time_lock_delta as a NumericProperty

total_satoshis_received

The channel’s total_satoshis_received

total_satoshis_sent

The channel’s total_satoshis_sent

unsettled_balance

The channel’s unsettled_balance

update(channel)

Update the given Channel object with the given lnd channel.

update_lnd_with_policies(*_)

Update LND with the channel policies specified in tbis object.