pub enum SpendingConditions {
P2PKConditions {
data: PublicKey,
conditions: Option<Conditions>,
},
HTLCConditions {
data: Hash,
conditions: Option<Conditions>,
},
}
Expand description
Spending Conditions
Defined in NUT10
Variants§
P2PKConditions
NUT11 Spending conditions
Defined in NUT11
Fields
§
conditions: Option<Conditions>
Additional Optional Spending Conditions
HTLCConditions
NUT14 Spending conditions
Dedined in NUT14
Fields
§
conditions: Option<Conditions>
Additional Optional Spending Conditions
Implementations§
Source§impl SpendingConditions
impl SpendingConditions
Sourcepub fn new_htlc(
preimage: String,
conditions: Option<Conditions>,
) -> Result<SpendingConditions, Error>
pub fn new_htlc( preimage: String, conditions: Option<Conditions>, ) -> Result<SpendingConditions, Error>
New HTLC SpendingConditions
Sourcepub fn new_htlc_hash(
hash: &str,
conditions: Option<Conditions>,
) -> Result<SpendingConditions, Error>
pub fn new_htlc_hash( hash: &str, conditions: Option<Conditions>, ) -> Result<SpendingConditions, Error>
New HTLC SpendingConditions from a hash directly instead of preimage
Sourcepub fn new_p2pk(
pubkey: PublicKey,
conditions: Option<Conditions>,
) -> SpendingConditions
pub fn new_p2pk( pubkey: PublicKey, conditions: Option<Conditions>, ) -> SpendingConditions
New P2PK SpendingConditions
Sourcepub fn kind(&self) -> Kind
pub fn kind(&self) -> Kind
Kind of SpendingConditions
Sourcepub fn refund_keys(&self) -> Option<Vec<PublicKey>>
pub fn refund_keys(&self) -> Option<Vec<PublicKey>>
Refund keys
Trait Implementations§
Source§impl Clone for SpendingConditions
impl Clone for SpendingConditions
Source§fn clone(&self) -> SpendingConditions
fn clone(&self) -> SpendingConditions
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 SpendingConditions
impl Debug for SpendingConditions
Source§impl<'de> Deserialize<'de> for SpendingConditions
impl<'de> Deserialize<'de> for SpendingConditions
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SpendingConditions, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SpendingConditions, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<SpendingConditions> for Secret
impl From<SpendingConditions> for Secret
Source§fn from(conditions: SpendingConditions) -> Secret
fn from(conditions: SpendingConditions) -> Secret
Converts to this type from the input type.
Source§impl From<SpendingConditions> for Nut10SecretRequest
impl From<SpendingConditions> for Nut10SecretRequest
Source§fn from(conditions: SpendingConditions) -> Nut10SecretRequest
fn from(conditions: SpendingConditions) -> Nut10SecretRequest
Converts to this type from the input type.
Source§impl Hash for SpendingConditions
impl Hash for SpendingConditions
Source§impl PartialEq for SpendingConditions
impl PartialEq for SpendingConditions
Source§impl Serialize for SpendingConditions
impl Serialize for SpendingConditions
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl TryFrom<&Secret> for SpendingConditions
impl TryFrom<&Secret> for SpendingConditions
Source§impl TryFrom<Secret> for SpendingConditions
impl TryFrom<Secret> for SpendingConditions
impl Eq for SpendingConditions
impl StructuralPartialEq for SpendingConditions
Auto Trait Implementations§
impl Freeze for SpendingConditions
impl RefUnwindSafe for SpendingConditions
impl Send for SpendingConditions
impl Sync for SpendingConditions
impl Unpin for SpendingConditions
impl UnwindSafe for SpendingConditions
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