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
impl Launcher
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>
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>
pub fn create_simple_did(
self,
ctx: &mut SpendContext,
synthetic_key: PublicKey,
) -> Result<(Conditions, Did<()>), DriverError>where
Self: Sized,
source§impl Launcher
impl Launcher
sourcepub fn from_coin(coin: Coin, conditions: Conditions) -> Self
pub fn from_coin(coin: Coin, conditions: Conditions) -> Self
Creates a new Launcher
with the specified launcher coin and parent spend conditions.
sourcepub fn new(parent_coin_id: Bytes32, amount: u64) -> Self
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
.
sourcepub fn hinted(parent_coin_id: Bytes32, amount: u64, hint: Bytes32) -> Self
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.
sourcepub fn create_early(parent_coin_id: Bytes32, amount: u64) -> (Conditions, Self)
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.
sourcepub fn create_early_hinted(
parent_coin_id: Bytes32,
amount: u64,
hint: Bytes32,
) -> (Conditions, Self)
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.
sourcepub fn coin(&self) -> Coin
pub fn coin(&self) -> Coin
The singleton launcher coin that will be created when the parent is spent.
sourcepub fn spend<T>(
self,
ctx: &mut SpendContext,
singleton_inner_puzzle_hash: Bytes32,
key_value_list: T,
) -> Result<(Conditions, Coin), DriverError>
pub fn spend<T>( self, ctx: &mut SpendContext, singleton_inner_puzzle_hash: Bytes32, key_value_list: T, ) -> Result<(Conditions, Coin), DriverError>
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
impl Launcher
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>
pub fn mint_nft<M>( self, ctx: &mut SpendContext, mint: NftMint<M>, ) -> Result<(Conditions, Nft<M>), DriverError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Launcher
impl RefUnwindSafe for Launcher
impl Send for Launcher
impl Sync for Launcher
impl Unpin for Launcher
impl UnwindSafe for Launcher
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)