Struct chia_sdk_driver::Launcher

source ·
pub struct Launcher { /* private fields */ }
Expand description

A singleton launcher is a coin that is spent within the same block to create a singleton. The first coin that is created is known as an “eve” singleton. The Launcher type allows you to get the launcher id before committing to creating the singleton.

Implementations§

source§

impl Launcher

source

pub fn create_eve_did<M>( self, ctx: &mut SpendContext, p2_puzzle_hash: Bytes32, recovery_list_hash: Bytes32, num_verifications_required: u64, metadata: M, ) -> Result<(Conditions, Did<M>), DriverError>

source

pub fn create_did<M>( self, ctx: &mut SpendContext, recovery_list_hash: Bytes32, num_verifications_required: u64, metadata: M, synthetic_key: PublicKey, ) -> Result<(Conditions, Did<M>), DriverError>
where M: ToClvm<Allocator> + FromClvm<Allocator> + Clone, Self: Sized,

source

pub fn create_simple_did( self, ctx: &mut SpendContext, synthetic_key: PublicKey, ) -> Result<(Conditions, Did<()>), DriverError>
where Self: Sized,

source§

impl Launcher

source

pub fn from_coin(coin: Coin, conditions: Conditions) -> Self

Creates a new Launcher with the specified launcher coin and parent spend conditions.

source

pub fn new(parent_coin_id: Bytes32, amount: u64) -> Self

The parent coin specified when constructing the Launcher will create the launcher coin. By default, no hint is used when creating the launcher coin. To specify a hint, use Launcher::hinted.

source

pub fn hinted(parent_coin_id: Bytes32, amount: u64, hint: Bytes32) -> Self

The parent coin specified when constructing the Launcher will create the launcher coin. The created launcher coin will be hinted to make identifying it easier later.

source

pub fn create_early(parent_coin_id: Bytes32, amount: u64) -> (Conditions, Self)

The parent coin specified when constructing the Launcher will create the launcher coin. By default, no hint is used when creating the coin. To specify a hint, use Launcher::create_early_hinted.

This method is used to create the launcher coin immediately from the parent, then spend it later attached to any coin spend. For example, this is useful for minting NFTs from intermediate coins created with an earlier instance of a DID.

source

pub fn create_early_hinted( parent_coin_id: Bytes32, amount: u64, hint: Bytes32, ) -> (Conditions, Self)

The parent coin specified when constructing the Launcher will create the launcher coin. The created launcher coin will be hinted to make identifying it easier later.

This method is used to create the launcher coin immediately from the parent, then spend it later attached to any coin spend. For example, this is useful for minting NFTs from intermediate coins created with an earlier instance of a DID.

source

pub fn coin(&self) -> Coin

The singleton launcher coin that will be created when the parent is spent.

source

pub fn spend<T>( self, ctx: &mut SpendContext, singleton_inner_puzzle_hash: Bytes32, key_value_list: T, ) -> Result<(Conditions, Coin), DriverError>
where T: ToClvm<Allocator>,

Spends the launcher coin to create the eve singleton. Includes an optional metadata value that is traditionally a list of key value pairs.

source§

impl Launcher

source

pub fn mint_eve_nft<M>( self, ctx: &mut SpendContext, p2_puzzle_hash: Bytes32, metadata: M, metadata_updater_puzzle_hash: Bytes32, royalty_puzzle_hash: Bytes32, royalty_ten_thousandths: u16, ) -> Result<(Conditions, Nft<M>), DriverError>

source

pub fn mint_nft<M>( self, ctx: &mut SpendContext, mint: NftMint<M>, ) -> Result<(Conditions, Nft<M>), DriverError>

Trait Implementations§

source§

impl Clone for Launcher

source§

fn clone(&self) -> Launcher

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for Launcher

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
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> Same for T

§

type Output = T

Should always be Self
source§

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

§

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>,

§

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>,

§

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.