pub enum OnchainBalanceState {
Unavailable,
Available {
withdrawable_sat: u64,
emergency_reserve_sat: u64,
unconfirmed_sat: u64,
},
ReserveOnly {
reserve_sat: u64,
},
PendingConfirmation {
unconfirmed_sat: u64,
},
Immature {
immature_sat: u64,
},
}Expand description
Classifies the on-chain wallet into discrete cases that a wallet
UI can switch on to render the correct entry-point for the
withdraw flow. Derived purely from NodeState — no RPC.
Variants§
No funds on-chain in any form (confirmed, unconfirmed, immature, or pending channel-close payouts are all zero). Don’t render a withdraw entry point.
Available
Funds are spendable now. Render the withdraw entry point
enabled with withdrawable_sat as the headline.
Fields
withdrawable_sat: u64onchain_balance_sat - emergency_reserve_sat. Use as
the displayed amount on the entry point.
ReserveOnly
On-chain funds exist but are entirely locked as the anchor-channel emergency reserve. Render the entry point disabled with an explainer (e.g. “close channels to free these funds”).
PendingConfirmation
Inbound on-chain funds are awaiting confirmation. Render a “pending” indicator instead of an enabled withdraw button.
Immature
Funds exist as CSV-timelocked outputs from a recent channel close and can’t be spent until the relative locktime expires. Render the entry point disabled with a “channel closing” explainer.
Trait Implementations§
Source§impl Clone for OnchainBalanceState
impl Clone for OnchainBalanceState
Source§fn clone(&self) -> OnchainBalanceState
fn clone(&self) -> OnchainBalanceState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<UT> ConvertError<UT> for OnchainBalanceState
impl<UT> ConvertError<UT> for OnchainBalanceState
fn try_convert_unexpected_callback_error( e: UnexpectedUniFFICallbackError, ) -> Result<Self>
Source§impl<UT> FfiConverter<UT> for OnchainBalanceState
impl<UT> FfiConverter<UT> for OnchainBalanceState
Source§const TYPE_ID_META: MetadataBuffer
const TYPE_ID_META: MetadataBuffer
Source§type FfiType = RustBuffer
type FfiType = RustBuffer
Source§fn lower(v: Self) -> RustBuffer
fn lower(v: Self) -> RustBuffer
Source§fn try_lift(buf: RustBuffer) -> Result<Self>
fn try_lift(buf: RustBuffer) -> Result<Self>
Source§impl<UT> Lift<UT> for OnchainBalanceState
impl<UT> Lift<UT> for OnchainBalanceState
Source§impl<UT> LiftRef<UT> for OnchainBalanceState
impl<UT> LiftRef<UT> for OnchainBalanceState
Source§impl<UT> LiftReturn<UT> for OnchainBalanceState
impl<UT> LiftReturn<UT> for OnchainBalanceState
Source§type ReturnType = <OnchainBalanceState as Lift<UT>>::FfiType
type ReturnType = <OnchainBalanceState as Lift<UT>>::FfiType
Source§fn try_lift_successful_return(v: Self::ReturnType) -> Result<Self>
fn try_lift_successful_return(v: Self::ReturnType) -> Result<Self>
Source§fn lift_foreign_return(
ffi_return: Self::ReturnType,
call_status: RustCallStatus,
) -> Self
fn lift_foreign_return( ffi_return: Self::ReturnType, call_status: RustCallStatus, ) -> Self
Source§fn lift_error(_buf: RustBuffer) -> Self
fn lift_error(_buf: RustBuffer) -> Self
Source§fn handle_callback_unexpected_error(e: UnexpectedUniFFICallbackError) -> Self
fn handle_callback_unexpected_error(e: UnexpectedUniFFICallbackError) -> Self
Source§impl<UT> Lower<UT> for OnchainBalanceState
impl<UT> Lower<UT> for OnchainBalanceState
type FfiType = <OnchainBalanceState as FfiConverter<UT>>::FfiType
fn lower(obj: Self) -> Self::FfiType
fn write(obj: Self, buf: &mut Vec<u8>)
Source§fn lower_into_rust_buffer(obj: Self) -> RustBuffer
fn lower_into_rust_buffer(obj: Self) -> RustBuffer
Source§impl<UT> LowerError<UT> for OnchainBalanceState
impl<UT> LowerError<UT> for OnchainBalanceState
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Source§impl<UT> LowerReturn<UT> for OnchainBalanceState
impl<UT> LowerReturn<UT> for OnchainBalanceState
Source§type ReturnType = <OnchainBalanceState as Lower<UT>>::FfiType
type ReturnType = <OnchainBalanceState as Lower<UT>>::FfiType
Source§fn lower_return(v: Self) -> Result<Self::ReturnType, RustCallError>
fn lower_return(v: Self) -> Result<Self::ReturnType, RustCallError>
Source§fn handle_failed_lift(
error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
Source§impl<UT> TypeId<UT> for OnchainBalanceState
impl<UT> TypeId<UT> for OnchainBalanceState
Auto Trait Implementations§
impl Freeze for OnchainBalanceState
impl RefUnwindSafe for OnchainBalanceState
impl Send for OnchainBalanceState
impl Sync for OnchainBalanceState
impl Unpin for OnchainBalanceState
impl UnsafeUnpin for OnchainBalanceState
impl UnwindSafe for OnchainBalanceState
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for T
impl<T> Downcast for T
Source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request