pub struct OffboardRequest {
pub script_pubkey: ScriptBuf,
pub amount: Amount,
}Fields§
§script_pubkey: ScriptBuf§amount: AmountImplementations§
Source§impl OffboardRequest
impl OffboardRequest
Sourcepub fn calculate_fee(
script_pubkey: &Script,
fee_rate: FeeRate,
fixed_weight_charged: Weight,
) -> Option<Amount>
pub fn calculate_fee( script_pubkey: &Script, fee_rate: FeeRate, fixed_weight_charged: Weight, ) -> Option<Amount>
Calculate the fee we have to charge for adding an output with the given scriptPubkey to a transaction.
Use the fixed_weight_charged argument to add the fixed fee part that the
server charges. This will be added to the offboard’s output size
and multiplied with the given fee rate.
Returns None in the calculation overflows because of insane
scriptPubkey or fee rate.
Sourcepub fn validate(&self) -> Result<(), InvalidOffboardRequestError>
pub fn validate(&self) -> Result<(), InvalidOffboardRequestError>
Validate that the offboard has a valid script.
Sourcepub fn fee(
&self,
fee_rate: FeeRate,
fixed_weight_charged: Weight,
) -> Option<Amount>
pub fn fee( &self, fee_rate: FeeRate, fixed_weight_charged: Weight, ) -> Option<Amount>
Returns the fee charged for the user to make this offboard given the fee rate
Use the fixed_weight_charged argument to add the fixed fee part that the
server charges. This will be added to the offboard’s output size
and multiplied with the given fee rate.
Returns None in the calculation overflows because of insane
scriptPubkey or fee rate.
Trait Implementations§
Source§impl Clone for OffboardRequest
impl Clone for OffboardRequest
Source§fn clone(&self) -> OffboardRequest
fn clone(&self) -> OffboardRequest
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OffboardRequest
impl Debug for OffboardRequest
Source§impl<'de> Deserialize<'de> for OffboardRequest
impl<'de> Deserialize<'de> for OffboardRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Hash for OffboardRequest
impl Hash for OffboardRequest
Source§impl Ord for OffboardRequest
impl Ord for OffboardRequest
Source§fn cmp(&self, other: &OffboardRequest) -> Ordering
fn cmp(&self, other: &OffboardRequest) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for OffboardRequest
impl PartialEq for OffboardRequest
Source§impl PartialOrd for OffboardRequest
impl PartialOrd for OffboardRequest
Source§impl Serialize for OffboardRequest
impl Serialize for OffboardRequest
impl Eq for OffboardRequest
impl StructuralPartialEq for OffboardRequest
Auto Trait Implementations§
impl Freeze for OffboardRequest
impl RefUnwindSafe for OffboardRequest
impl Send for OffboardRequest
impl Sync for OffboardRequest
impl Unpin for OffboardRequest
impl UnwindSafe for OffboardRequest
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.