Skip to main content

Asset

Struct Asset 

Source
pub struct Asset {
Show 20 fields pub version: AssetVersion, pub asset_genesis: Option<GenesisInfo>, pub amount: u64, pub lock_time: i32, pub relative_lock_time: i32, pub script_version: i32, pub script_key: Vec<u8>, pub script_key_is_local: bool, pub asset_group: Option<AssetGroup>, pub chain_anchor: Option<AnchorInfo>, pub prev_witnesses: Vec<PrevWitness>, pub split_commitment_root: Option<MssmtNode>, pub is_spent: bool, pub lease_owner: Vec<u8>, pub lease_expiry: i64, pub is_burn: bool, pub script_key_declared_known: bool, pub script_key_has_script_path: bool, pub decimal_display: Option<DecimalDisplay>, pub script_key_type: ScriptKeyType,
}
Expand description

Represents a Taproot Asset.

Fields§

§version: AssetVersion

The version of the Taproot Asset.

§asset_genesis: Option<GenesisInfo>

The base genesis information of an asset. This information never changes.

§amount: u64

The total amount of the asset stored in this Taproot Asset UTXO.

§lock_time: i32

An optional locktime, as with Bitcoin transactions.

§relative_lock_time: i32

An optional relative lock time, same as Bitcoin transactions.

§script_version: i32

The version of the script, only version 0 is defined at present.

§script_key: Vec<u8>

The script key of the asset, which can be spent under Taproot semantics.

§script_key_is_local: bool

Indicates whether the script key is known to the wallet of the lnd node connected to the Taproot Asset daemon.

§asset_group: Option<AssetGroup>

The information related to the key group of an asset (if it exists).

§chain_anchor: Option<AnchorInfo>

Describes where in the chain the asset is currently anchored.

§prev_witnesses: Vec<PrevWitness>

Previous witnesses for the asset.

§split_commitment_root: Option<MssmtNode>

The root node of the MS-SMT storing split commitments, if present.

§is_spent: bool

Indicates whether the asset has been spent.

§lease_owner: Vec<u8>

If the asset has been leased, this is the owner (application ID) of the lease.

§lease_expiry: i64

If the asset has been leased, this is the expiry of the lease as a Unix timestamp in seconds.

§is_burn: bool

Indicates whether this transfer was an asset burn. If true, the number of assets in this output are destroyed and can no longer be spent.

§script_key_declared_known: bool

Deprecated, use script_key_type instead! Indicates whether this script key has either been derived by the local wallet or was explicitly declared to be known by using the DeclareScriptKey RPC. Knowing the key conceptually means the key belongs to the local wallet or is at least known by a software that operates on the local wallet. The flag is never serialized in proofs, so this is never explicitly set for keys foreign to the local wallet. Therefore, if this method returns true for a script key, it means the asset with the script key will be shown in the wallet balance.

§script_key_has_script_path: bool

Deprecated, use script_key_type instead! Indicates whether the script key is known to have a Tapscript spend path, meaning that the Taproot merkle root tweak is not empty. This will only ever be true if either script_key_is_local or script_key_internals_known is true as well, since the presence of a Tapscript spend path cannot be determined for script keys that aren’t known to the wallet of the local tapd node.

§decimal_display: Option<DecimalDisplay>

This field defines a decimal display value that may be present. If this field is null, it means the presence of a decimal display field is unknown in the current context.

§script_key_type: ScriptKeyType

The type of the script key. This type is either user-declared when custom script keys are added, or automatically determined by the daemon for standard operations (e.g. BIP-86 keys, burn keys, tombstone keys, channel related keys).

Implementations§

Source§

impl Asset

Source

pub fn decode_tlv<R: Read>(r: R) -> Result<Self, Error>

Decodes an Asset from a TLV byte slice.

Trait Implementations§

Source§

impl Clone for Asset

Source§

fn clone(&self) -> Asset

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Asset

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Asset

Source§

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 Eq for Asset

Source§

impl Hash for Asset

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Asset

Source§

fn eq(&self, other: &Asset) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Asset

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Asset

Auto Trait Implementations§

§

impl Freeze for Asset

§

impl RefUnwindSafe for Asset

§

impl Send for Asset

§

impl Sync for Asset

§

impl Unpin for Asset

§

impl UnsafeUnpin for Asset

§

impl UnwindSafe for Asset

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.