pub enum VtxoPolicy {
Pubkey(PubkeyVtxoPolicy),
ServerHtlcSend(ServerHtlcSendVtxoPolicy),
ServerHtlcRecv(ServerHtlcRecvVtxoPolicy),
}Expand description
The output policy of the VTXO.
Variants§
Pubkey(PubkeyVtxoPolicy)
Standard VTXO output protected with a public key.
This can be the result of either:
- a board
- a round
- an arkoor tx
- change from a LN payment
ServerHtlcSend(ServerHtlcSendVtxoPolicy)
A VTXO that represents an HTLC with the Ark server to send money.
ServerHtlcRecv(ServerHtlcRecvVtxoPolicy)
A VTXO that represents an HTLC with the Ark server to receive money.
Implementations§
Source§impl VtxoPolicy
impl VtxoPolicy
pub fn new_pubkey(user_pubkey: PublicKey) -> Self
pub fn new_server_htlc_send( user_pubkey: PublicKey, payment_hash: PaymentHash, htlc_expiry: BlockHeight, ) -> Self
pub fn new_server_htlc_recv( user_pubkey: PublicKey, payment_hash: PaymentHash, htlc_expiry: BlockHeight, ) -> Self
pub fn as_pubkey(&self) -> Option<&PubkeyVtxoPolicy>
pub fn as_server_htlc_send(&self) -> Option<&ServerHtlcSendVtxoPolicy>
pub fn as_server_htlc_recv(&self) -> Option<&ServerHtlcRecvVtxoPolicy>
Sourcepub fn policy_type(&self) -> VtxoPolicyType
pub fn policy_type(&self) -> VtxoPolicyType
The policy type id.
Sourcepub fn is_arkoor_compatible(&self) -> bool
pub fn is_arkoor_compatible(&self) -> bool
Whether a Vtxo with this output can be spend in an arkoor tx.
Sourcepub fn arkoor_pubkey(&self) -> Option<PublicKey>
pub fn arkoor_pubkey(&self) -> Option<PublicKey>
The public key used to cosign arkoor txs spending a Vtxo with this output. This will return None if VtxoPolicy::is_arkoor_compatible returns false.
Sourcepub fn user_pubkey(&self) -> PublicKey
pub fn user_pubkey(&self) -> PublicKey
Returns the user pubkey associated with a Vtxo with this output.
Sourcepub fn user_exit_clause(&self, exit_delta: u16) -> ScriptBuf
pub fn user_exit_clause(&self, exit_delta: u16) -> ScriptBuf
Returns the tapscript internal to the VtxoPolicy::taproot that is used for the user exit.
Trait Implementations§
Source§impl Clone for VtxoPolicy
impl Clone for VtxoPolicy
Source§fn clone(&self) -> VtxoPolicy
fn clone(&self) -> VtxoPolicy
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 VtxoPolicy
impl Debug for VtxoPolicy
Source§impl From<PubkeyVtxoPolicy> for VtxoPolicy
impl From<PubkeyVtxoPolicy> for VtxoPolicy
Source§fn from(policy: PubkeyVtxoPolicy) -> Self
fn from(policy: PubkeyVtxoPolicy) -> Self
Converts to this type from the input type.
Source§impl From<ServerHtlcRecvVtxoPolicy> for VtxoPolicy
impl From<ServerHtlcRecvVtxoPolicy> for VtxoPolicy
Source§fn from(policy: ServerHtlcRecvVtxoPolicy) -> Self
fn from(policy: ServerHtlcRecvVtxoPolicy) -> Self
Converts to this type from the input type.
Source§impl From<ServerHtlcSendVtxoPolicy> for VtxoPolicy
impl From<ServerHtlcSendVtxoPolicy> for VtxoPolicy
Source§fn from(policy: ServerHtlcSendVtxoPolicy) -> Self
fn from(policy: ServerHtlcSendVtxoPolicy) -> Self
Converts to this type from the input type.
Source§impl Hash for VtxoPolicy
impl Hash for VtxoPolicy
Source§impl Ord for VtxoPolicy
impl Ord for VtxoPolicy
Source§fn cmp(&self, other: &VtxoPolicy) -> Ordering
fn cmp(&self, other: &VtxoPolicy) -> 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 VtxoPolicy
impl PartialEq for VtxoPolicy
Source§impl PartialOrd for VtxoPolicy
impl PartialOrd for VtxoPolicy
Source§impl ProtocolEncoding for VtxoPolicy
impl ProtocolEncoding for VtxoPolicy
Source§fn encode<W: Write + ?Sized>(&self, w: &mut W) -> Result<(), Error>
fn encode<W: Write + ?Sized>(&self, w: &mut W) -> Result<(), Error>
Encode the object into the writer.
Source§fn decode<R: Read + ?Sized>(r: &mut R) -> Result<Self, ProtocolDecodingError>
fn decode<R: Read + ?Sized>(r: &mut R) -> Result<Self, ProtocolDecodingError>
Decode the object from the writer.
Source§fn deserialize(byte_slice: &[u8]) -> Result<Self, ProtocolDecodingError>
fn deserialize(byte_slice: &[u8]) -> Result<Self, ProtocolDecodingError>
Deserialize object from the given byte slice.
Source§fn serialize_hex(&self) -> String
fn serialize_hex(&self) -> String
Serialize the object to a lowercase hex string.
Source§fn deserialize_hex(hex_str: &str) -> Result<Self, ProtocolDecodingError>
fn deserialize_hex(hex_str: &str) -> Result<Self, ProtocolDecodingError>
Deserialize object from hex slice.
impl Eq for VtxoPolicy
impl StructuralPartialEq for VtxoPolicy
Auto Trait Implementations§
impl Freeze for VtxoPolicy
impl RefUnwindSafe for VtxoPolicy
impl Send for VtxoPolicy
impl Sync for VtxoPolicy
impl Unpin for VtxoPolicy
impl UnwindSafe for VtxoPolicy
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