pub struct WalletVtxo {
pub vtxo: Vtxo<Full>,
pub state: VtxoState,
}Expand description
A wallet-owned Vtxo paired with its current tracked state.
Fields§
§vtxo: Vtxo<Full>The underlying Vtxo.
state: VtxoStateThe current tracked state for [WalletVtxo::into_vtxo].
Methods from Deref<Target = Vtxo<Full>>§
Sourcepub fn id(&self) -> VtxoId
pub fn id(&self) -> VtxoId
Get the identifier for this Vtxo.
This is the same as Vtxo::point but encoded as a byte array.
Sourcepub fn point(&self) -> OutPoint
pub fn point(&self) -> OutPoint
The outpoint from which to build forfeit or arkoor txs.
This can be an on-chain utxo or an off-chain vtxo.
Sourcepub fn chain_anchor(&self) -> OutPoint
pub fn chain_anchor(&self) -> OutPoint
The UTXO that should be confirmed for this Vtxo to be valid.
It is the very root of the VTXO.
Sourcepub fn policy_type(&self) -> VtxoPolicyKind
pub fn policy_type(&self) -> VtxoPolicyKind
The output policy type of this VTXO.
Sourcepub fn expiry_height(&self) -> u32
pub fn expiry_height(&self) -> u32
The expiry height of the Vtxo.
Sourcepub fn server_pubkey(&self) -> PublicKey
pub fn server_pubkey(&self) -> PublicKey
The server pubkey used in arkoor transitions.
Sourcepub fn exit_delta(&self) -> u16
pub fn exit_delta(&self) -> u16
The relative timelock block delta used for exits.
Sourcepub fn output_taproot(&self) -> TaprootSpendInfo
pub fn output_taproot(&self) -> TaprootSpendInfo
The taproot spend info for the output of this Vtxo.
Sourcepub fn output_script_pubkey(&self) -> ScriptBuf
pub fn output_script_pubkey(&self) -> ScriptBuf
The scriptPubkey of the output of this Vtxo.
Sourcepub fn exit_depth(&self) -> u16
pub fn exit_depth(&self) -> u16
Returns the total exit depth (including OOR depth) of the vtxo.
Sourcepub fn past_arkoor_pubkeys(&self) -> Vec<Vec<PublicKey>>
pub fn past_arkoor_pubkeys(&self) -> Vec<Vec<PublicKey>>
Iterate over all oor transitions in this VTXO
The outer Vec cointains one element for each transition.
The inner Vec contains all pubkeys within that transition.
This does not include the current arkoor pubkey, for that use Vtxo::arkoor_pubkey.
Sourcepub fn has_all_witnesses(&self) -> bool
pub fn has_all_witnesses(&self) -> bool
Whether all transaction witnesses are present
It is possible to represent unsigned or otherwise unfinished VTXOs, for which this method will return false.
Sourcepub fn is_standard(&self) -> bool
pub fn is_standard(&self) -> bool
Check if this VTXO is standard for relay purposes
A VTXO is standard if:
- Its own output is standard
- all sibling outputs in the exit path are standard
- each part of the exit path should have a P2A output
Sourcepub fn unlock_hash(&self) -> Option<Hash>
pub fn unlock_hash(&self) -> Option<Hash>
Returns the “hArk” unlock hash if this is a hArk leaf VTXO
Sourcepub fn transactions(&self) -> VtxoTxIter<'_, P>
pub fn transactions(&self) -> VtxoTxIter<'_, P>
Iterator that constructs all the exit txs for this Vtxo.
Sourcepub fn validate(
&self,
chain_anchor_tx: &Transaction,
) -> Result<(), VtxoValidationError>
pub fn validate( &self, chain_anchor_tx: &Transaction, ) -> Result<(), VtxoValidationError>
Fully validate this VTXO and its entire transaction chain.
The chain_anchor_tx must be the tx with txid matching
Vtxo::chain_anchor.
Sourcepub fn validate_unsigned(
&self,
chain_anchor_tx: &Transaction,
) -> Result<(), VtxoValidationError>
pub fn validate_unsigned( &self, chain_anchor_tx: &Transaction, ) -> Result<(), VtxoValidationError>
Validate VTXO structure without checking signatures.
Sourcepub fn user_pubkey(&self) -> PublicKey
pub fn user_pubkey(&self) -> PublicKey
Returns the user pubkey associated with this Vtxo.
Sourcepub fn arkoor_pubkey(&self) -> Option<PublicKey>
pub fn arkoor_pubkey(&self) -> Option<PublicKey>
The public key used to cosign arkoor txs spending this Vtxo. This will return None if VtxoPolicy::is_arkoor_compatible returns false for this VTXO’s policy.
Trait Implementations§
Source§impl AsRef<Vtxo> for WalletVtxo
impl AsRef<Vtxo> for WalletVtxo
Source§impl Clone for WalletVtxo
impl Clone for WalletVtxo
Source§fn clone(&self) -> WalletVtxo
fn clone(&self) -> WalletVtxo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WalletVtxo
impl Debug for WalletVtxo
Source§impl<'de> Deserialize<'de> for WalletVtxo
impl<'de> Deserialize<'de> for WalletVtxo
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>,
Source§impl PartialEq for WalletVtxo
impl PartialEq for WalletVtxo
Source§impl Serialize for WalletVtxo
impl Serialize for WalletVtxo
Source§impl<'a> VtxoRef for &'a WalletVtxo
impl<'a> VtxoRef for &'a WalletVtxo
Source§impl VtxoRef for WalletVtxo
impl VtxoRef for WalletVtxo
Source§impl Deref for WalletVtxo
impl Deref for WalletVtxo
impl Eq for WalletVtxo
impl StructuralPartialEq for WalletVtxo
Auto Trait Implementations§
impl Freeze for WalletVtxo
impl RefUnwindSafe for WalletVtxo
impl Send for WalletVtxo
impl Sync for WalletVtxo
impl Unpin for WalletVtxo
impl UnwindSafe for WalletVtxo
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
key and return true if they are equal.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<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> 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