Module of Factory type
Structs
factory::Factory<C> has store, key
factory::Factory<C> has store, key
Fields:
| Name | Type | Description |
|---|---|---|
id
|
object::UID
|
|
mint_cap
|
loose_mint_cap::LooseMintCap<C>
|
|
Factory is an inventory that can mint loose NFTs
Each Factory may only mint NFTs from a single collection.
Methods
public fun from_regulated<C>(
mint_cap: mint_cap::RegulatedMintCap<C>,
collection: &mut collection::Collection<C>,
metadata_id: object::ID,
ctx: &mut tx_context::TxContext,
): factory::Factory<C>
public fun from_regulated<C>(
mint_cap: mint_cap::RegulatedMintCap<C>,
collection: &mut collection::Collection<C>,
metadata_id: object::ID,
ctx: &mut tx_context::TxContext,
): factory::Factory<C>Creates a new Factory
Factory supply is limited by both the supply of the Collection
and Archetype if either is regulated.
Panics
- Archetype
RegistryDomainis not registered Archetypedoes not exist
public fun from_unregulated<C>(
mint_cap: mint_cap::UnregulatedMintCap<C>,
collection: &mut collection::Collection<C>,
metadata_id: object::ID,
ctx: &mut tx_context::TxContext,
): factory::Factory<C>
public fun from_unregulated<C>(
mint_cap: mint_cap::UnregulatedMintCap<C>,
collection: &mut collection::Collection<C>,
metadata_id: object::ID,
ctx: &mut tx_context::TxContext,
): factory::Factory<C>Create Factory with unregulated supply
UnregulatedMintCap can be obtained from
supply_domain::delegate_unregulated.
public fun redeem_nft<C>(
factory: &mut factory::Factory<C>,
ctx: &mut tx_context::TxContext,
): nft::Nft<C>
public fun redeem_nft<C>(
factory: &mut factory::Factory<C>,
ctx: &mut tx_context::TxContext,
): nft::Nft<C>Mints NFT from Factory
Endpoint is unprotected and relies on safely obtaining a mutable
reference to Factory.
Panics
Panics if supply was exceeded.