breez_sdk_liquid::lightning::chain::channelmonitor

Enum Balance

pub enum Balance {
    ClaimableOnChannelClose {
        amount_satoshis: u64,
    },
    ClaimableAwaitingConfirmations {
        amount_satoshis: u64,
        confirmation_height: u32,
    },
    ContentiousClaimable {
        amount_satoshis: u64,
        timeout_height: u32,
        payment_hash: PaymentHash,
        payment_preimage: PaymentPreimage,
    },
    MaybeTimeoutClaimableHTLC {
        amount_satoshis: u64,
        claimable_height: u32,
        payment_hash: PaymentHash,
    },
    MaybePreimageClaimableHTLC {
        amount_satoshis: u64,
        expiry_height: u32,
        payment_hash: PaymentHash,
    },
    CounterpartyRevokedOutputClaimable {
        amount_satoshis: u64,
    },
}
Expand description

Details about the balance(s) available for spending once the channel appears on chain.

See ChannelMonitor::get_claimable_balances for more details on when these will or will not be provided.

Variants§

§

ClaimableOnChannelClose

The channel is not yet closed (or the commitment or closing transaction has not yet appeared in a block). The given balance is claimable (less on-chain fees) if the channel is force-closed now.

Fields

§amount_satoshis: u64

The amount available to claim, in satoshis, excluding the on-chain fees which will be required to do so.

§

ClaimableAwaitingConfirmations

The channel has been closed, and the given balance is ours but awaiting confirmations until we consider it spendable.

Fields

§amount_satoshis: u64

The amount available to claim, in satoshis, possibly excluding the on-chain fees which were spent in broadcasting the transaction.

§confirmation_height: u32

The height at which an Event::SpendableOutputs event will be generated for this amount.

§

ContentiousClaimable

The channel has been closed, and the given balance should be ours but awaiting spending transaction confirmation. If the spending transaction does not confirm in time, it is possible our counterparty can take the funds by broadcasting an HTLC timeout on-chain.

Once the spending transaction confirms, before it has reached enough confirmations to be considered safe from chain reorganizations, the balance will instead be provided via Balance::ClaimableAwaitingConfirmations.

Fields

§amount_satoshis: u64

The amount available to claim, in satoshis, excluding the on-chain fees which will be required to do so.

§timeout_height: u32

The height at which the counterparty may be able to claim the balance if we have not done so.

§payment_hash: PaymentHash

The payment hash that locks this HTLC.

§payment_preimage: PaymentPreimage

The preimage that can be used to claim this HTLC.

§

MaybeTimeoutClaimableHTLC

HTLCs which we sent to our counterparty which are claimable after a timeout (less on-chain fees) if the counterparty does not know the preimage for the HTLCs. These are somewhat likely to be claimed by our counterparty before we do.

Fields

§amount_satoshis: u64

The amount potentially available to claim, in satoshis, excluding the on-chain fees which will be required to do so.

§claimable_height: u32

The height at which we will be able to claim the balance if our counterparty has not done so.

§payment_hash: PaymentHash

The payment hash whose preimage our counterparty needs to claim this HTLC.

§

MaybePreimageClaimableHTLC

HTLCs which we received from our counterparty which are claimable with a preimage which we do not currently have. This will only be claimable if we receive the preimage from the node to which we forwarded this HTLC before the timeout.

Fields

§amount_satoshis: u64

The amount potentially available to claim, in satoshis, excluding the on-chain fees which will be required to do so.

§expiry_height: u32

The height at which our counterparty will be able to claim the balance if we have not yet received the preimage and claimed it ourselves.

§payment_hash: PaymentHash

The payment hash whose preimage we need to claim this HTLC.

§

CounterpartyRevokedOutputClaimable

The channel has been closed, and our counterparty broadcasted a revoked commitment transaction.

Thus, we’re able to claim all outputs in the commitment transaction, one of which has the following amount.

Fields

§amount_satoshis: u64

The amount, in satoshis, of the output which we can claim.

Note that for outputs from HTLC balances this may be excluding some on-chain fees that were already spent.

Implementations§

§

impl Balance

pub fn claimable_amount_satoshis(&self) -> u64

The amount claimable, in satoshis. This excludes balances that we are unsure if we are able to claim, this is because we are waiting for a preimage or for a timeout to expire. For more information on these balances see Balance::MaybeTimeoutClaimableHTLC and Balance::MaybePreimageClaimableHTLC.

On-chain fees required to claim the balance are not included in this amount.

Trait Implementations§

§

impl Clone for Balance

§

fn clone(&self) -> Balance

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for Balance

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl PartialEq for Balance

§

fn eq(&self, other: &Balance) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl Eq for Balance

§

impl StructuralPartialEq for Balance

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

impl<T> Same for T

source§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> DartSafe for T

§

impl<T> TaskRetFutTrait for T
where T: Send,