pub struct TaprootAsset {
pub asset_id: [u8; 32],
pub name: String,
pub supply: u64,
pub precision: u8,
pub metadata: String,
pub issued: bool,
pub leaves: Vec<ScriptBuf>,
pub num_leaves: u32,
pub issuer_pubkey: [u8; 32],
}Expand description
Taproot Asset structure
Fields§
§asset_id: [u8; 32]Unique identifier for the asset (SHA-256 hash of asset properties)
name: StringName of the asset (1-32 characters)
supply: u64Total supply of the asset (must be > 0)
precision: u8Number of decimal places (0-8)
metadata: StringAdditional metadata (max 1024 bytes)
issued: boolWhether the asset has been issued on-chain
leaves: Vec<ScriptBuf>Taproot script leaves for the asset
num_leaves: u32Number of script leaves
issuer_pubkey: [u8; 32]Issuer’s public key (x-only, 32 bytes)
Implementations§
Source§impl TaprootAsset
impl TaprootAsset
Sourcepub fn new(
name: &str,
supply: u64,
precision: u8,
metadata: &str,
issuer_secret_key: &[u8],
) -> Result<Self, TaprootError>
pub fn new( name: &str, supply: u64, precision: u8, metadata: &str, issuer_secret_key: &[u8], ) -> Result<Self, TaprootError>
Create a new Taproot asset with the given parameters
Sourcepub fn create_asset_script(&self) -> Result<ScriptBuf, TaprootError>
pub fn create_asset_script(&self) -> Result<ScriptBuf, TaprootError>
Trait Implementations§
Source§impl Clone for TaprootAsset
impl Clone for TaprootAsset
Source§fn clone(&self) -> TaprootAsset
fn clone(&self) -> TaprootAsset
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 TaprootAsset
impl Debug for TaprootAsset
Source§impl<'de> Deserialize<'de> for TaprootAsset
impl<'de> Deserialize<'de> for TaprootAsset
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
Auto Trait Implementations§
impl Freeze for TaprootAsset
impl RefUnwindSafe for TaprootAsset
impl Send for TaprootAsset
impl Sync for TaprootAsset
impl Unpin for TaprootAsset
impl UnwindSafe for TaprootAsset
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<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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more