pub struct PreparedOnchainSend {
pub utxos: Vec<Outpoint>,
pub total_input_sat: u64,
pub fee_sat: u64,
pub recipient_sat: u64,
pub sat_per_vbyte: u32,
}Expand description
Preview of an on-chain send: the inputs CLN would select at the
given fee rate, the resulting fee, and the amount the recipient
would receive. Inputs are NOT reserved — the wallet is free to
spend them via other paths until onchain_send actually broadcasts.
Pass utxos and sat_per_vbyte back to onchain_send to broadcast
with identical inputs and fee.
Amounts are in satoshis: on-chain transactions cannot carry sub-sat precision, so msat denomination would be misleading here.
Fields§
§utxos: Vec<Outpoint>UTXOs that would be spent, in selection order.
total_input_sat: u64Sum of all input UTXO values, in satoshis.
fee_sat: u64Fee that would be paid, in satoshis.
recipient_sat: u64Amount the recipient would receive, in satoshis.
For a sweep (“all”) this equals total_input_sat - fee_sat.
For a fixed amount this equals the requested amount.
sat_per_vbyte: u32Effective fee rate (sat per virtual byte) the node used to
compute this preview. Equal to the caller’s sat_per_vbyte if
one was supplied; otherwise the rate the node picked at
“normal” priority. Pass this back to onchain_send to
reproduce the previewed fee.
Trait Implementations§
Source§impl<UT> ConvertError<UT> for PreparedOnchainSend
impl<UT> ConvertError<UT> for PreparedOnchainSend
fn try_convert_unexpected_callback_error( e: UnexpectedUniFFICallbackError, ) -> Result<Self>
Source§impl<UT> FfiConverter<UT> for PreparedOnchainSend
impl<UT> FfiConverter<UT> for PreparedOnchainSend
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 PreparedOnchainSend
impl<UT> Lift<UT> for PreparedOnchainSend
Source§impl<UT> LiftRef<UT> for PreparedOnchainSend
impl<UT> LiftRef<UT> for PreparedOnchainSend
Source§impl<UT> LiftReturn<UT> for PreparedOnchainSend
impl<UT> LiftReturn<UT> for PreparedOnchainSend
Source§type ReturnType = <PreparedOnchainSend as Lift<UT>>::FfiType
type ReturnType = <PreparedOnchainSend 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 PreparedOnchainSend
impl<UT> Lower<UT> for PreparedOnchainSend
type FfiType = <PreparedOnchainSend 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 PreparedOnchainSend
impl<UT> LowerError<UT> for PreparedOnchainSend
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Source§impl<UT> LowerReturn<UT> for PreparedOnchainSend
impl<UT> LowerReturn<UT> for PreparedOnchainSend
Source§type ReturnType = <PreparedOnchainSend as Lower<UT>>::FfiType
type ReturnType = <PreparedOnchainSend 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 PreparedOnchainSend
impl<UT> TypeId<UT> for PreparedOnchainSend
Auto Trait Implementations§
impl Freeze for PreparedOnchainSend
impl RefUnwindSafe for PreparedOnchainSend
impl Send for PreparedOnchainSend
impl Sync for PreparedOnchainSend
impl Unpin for PreparedOnchainSend
impl UnsafeUnpin for PreparedOnchainSend
impl UnwindSafe for PreparedOnchainSend
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> 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