pub struct ChannelClose { /* private fields */ }
Implementations§
source§impl ChannelClose
impl ChannelClose
sourcepub fn determine_resolving_fees(&self) -> Result<Option<OnchainResolvingFees>>
pub fn determine_resolving_fees(&self) -> Result<Option<OnchainResolvingFees>>
Returns the fees for resolving channel closes if there are enough funds to pay for fees.
Must only be called when there are onchain funds to resolve.
Returns the fee information for the available resolving options.
Requires network: yes
sourcepub fn prepare_sweep(
&self,
destination: BitcoinAddressData,
) -> Result<SweepChannelCloseInfo, RedeemOnchainError>
pub fn prepare_sweep( &self, destination: BitcoinAddressData, ) -> Result<SweepChannelCloseInfo, RedeemOnchainError>
Prepares a sweep of all available on-chain funds to the provided on-chain address.
Parameters:
destination
- the destination address to which funds will be sent. Can be obtained usingUtil::decode_data
Returns information on the prepared sweep, including the exact fee that results from
using the provided fee rate. The method ChannelClose::sweep
can be used to broadcast
the sweep transaction.
Requires network: yes
sourcepub fn sweep(&self, sweep_info: SweepChannelCloseInfo) -> Result<String>
pub fn sweep(&self, sweep_info: SweepChannelCloseInfo) -> Result<String>
Sweeps all available channel close funds to the specified on-chain address.
Parameters:
sweep_info
- a prepared sweep info that can be obtained usingChannelClose::prepare_sweep
Returns the txid of the sweep transaction.
Requires network: yes
sourcepub fn swap(&self, sat_per_vbyte: u32) -> Result<String, RedeemOnchainError>
pub fn swap(&self, sat_per_vbyte: u32) -> Result<String, RedeemOnchainError>
Automatically swaps on-chain funds back to lightning.
If a swap is in progress, this method will return an error.
If the current balance doesn’t fulfill the limits, this method will return an error.
Before using this method use ChannelClose::determine_resolving_fees
to validate a swap is available.
Parameters:
sat_per_vbyte
- the fee rate to use for the on-chain transaction. Can be obtained withChannelClose::determine_resolving_fees
.lsp_fee_params
- the lsp fee params for opening a new channel if necessary. Can be obtained withChannelClose::determine_resolving_fees
.
Returns the txid of the sweeping tx.
Requires network: yes
Auto Trait Implementations§
impl Freeze for ChannelClose
impl !RefUnwindSafe for ChannelClose
impl Send for ChannelClose
impl Sync for ChannelClose
impl Unpin for ChannelClose
impl !UnwindSafe for ChannelClose
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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
§impl<T> Downcast for Twhere
T: AsAny + ?Sized,
impl<T> Downcast for Twhere
T: AsAny + ?Sized,
§fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
Any
.§fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
Any
.§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Arc<>
Read more§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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