Type alias CandyMachineV2

CandyMachineV2: {
    model: "candyMachineV2";
    address: PublicKey;
    programAddress: PublicKey;
    version: 1 | 2;
    authorityAddress: PublicKey;
    walletAddress: PublicKey;
    tokenMintAddress: Option<PublicKey>;
    collectionMintAddress: Option<PublicKey>;
    uuid: string;
    price: Amount;
    symbol: string;
    sellerFeeBasisPoints: number;
    isMutable: boolean;
    retainAuthority: boolean;
    goLiveDate: Option<DateTime>;
    maxEditionSupply: BigNumber;
    items: CandyMachineV2Item[];
    itemsAvailable: BigNumber;
    itemsMinted: BigNumber;
    itemsRemaining: BigNumber;
    itemsLoaded: BigNumber;
    isFullyLoaded: boolean;
    endSettings: Option<CandyMachineV2EndSettings>;
    hiddenSettings: Option<CandyMachineV2HiddenSettings>;
    whitelistMintSettings: Option<CandyMachineV2WhitelistMintSettings>;
    gatekeeper: Option<CandyMachineV2Gatekeeper>;
    creators: Creator[];
}

This model contains all the relevant information about a Candy Machine. This includes its settings but also all of the items (a.k.a. config lines) loaded inside the Candy Machine along with some statistics about the items.

Type declaration

  • Readonly model: "candyMachineV2"

    A model identifier to distinguish models in the SDK.

  • Readonly address: PublicKey

    The address of the Candy Machine account.

  • Readonly programAddress: PublicKey

    The address of program that owns the Candy Machine account.

  • Readonly version: 1 | 2

    Whether this Candy Machine was created from v1 or v2.

  • Readonly authorityAddress: PublicKey

    The address of the authority that is allowed to manage this Candy Machine.

  • Readonly walletAddress: PublicKey

    The address of the wallet receiving the payments for minting NFTs. If the Candy Machine accepts payments in SOL, this is the SOL treasury account. Otherwise, this is the token account associated with the treasury Mint.

  • Readonly tokenMintAddress: Option<PublicKey>

    The address of the Mint account of the SPL Token that should be used to accept payments for minting NFTs. When null, it means the Candy Machine account accepts payments in SOL.

  • Readonly collectionMintAddress: Option<PublicKey>

    The mint address of the collection NFT that should be associated with minting NFTs. When null, it means NFTs will not be part of a collection when minted.

  • Readonly uuid: string

    A 6-character long unique identifier for the Candy Machine. This usually is the first 6 characters of the address. This is more of an internal field used by the program and you typically shouldn't need it.

  • Readonly price: Amount

    The price of minting an NFT.

    If the Candy Machine uses no treasury mint (i.e. the tokenMintAddress is null), this amount will be in SOL. Otherwise, its currency will match the currency of the treasury mint.

  • Readonly symbol: string

    The symbol to use when minting NFTs (e.g. "MYPROJECT")

    This can be any string up to 10 bytes and can be made optional by providing an empty string.

  • Readonly sellerFeeBasisPoints: number

    The royalties that should be set on minted NFTs in basis points (i.e. 250 is 2.5%).

  • Readonly isMutable: boolean

    Whether the minted NFTs should be mutable or not.

    We recommend setting this to true unless you have a specific reason. You can always make NFTs immutable in the future but you cannot make immutable NFTs mutable ever again.

  • Readonly retainAuthority: boolean

    Wheter the minted NFTs should use the Candy Machine authority as their update authority.

    We strongly recommend setting this to true unless you have a specific reason. When set to false, the update authority will be given to the address that minted the NFT and you will no longer be able to update the minted NFTs in the future.

  • Readonly goLiveDate: Option<DateTime>

    The timestamp of when the Candy Machine will be live.

    If this is null or if the timestamp refers to a time in the future, no one will be able to mint NFTs from the Candy Machine (except its authority that can bypass this live date).

  • Readonly maxEditionSupply: BigNumber

    The maximum number of editions that can be printed from the minted NFTs.

    For most use cases, you'd want to set this to 0 to prevent minted NFTs to be printed multiple times.

    Note that you cannot set this to null which means unlimited editions are not supported by the Candy Machine program.

  • Readonly items: CandyMachineV2Item[]

    The parsed items that are loaded in the Candy Machine.

    If the Candy Machine is using hidden settings, this will be an empty array.

  • Readonly itemsAvailable: BigNumber

    The total number of items availble in the Candy Machine, minted or not.

  • Readonly itemsMinted: BigNumber

    The number of items that have been minted on this Candy Machine so far.

  • Readonly itemsRemaining: BigNumber

    The number of remaining items in the Candy Machine that can still be minted.

  • Readonly itemsLoaded: BigNumber

    The number of items that have been inserted in the Candy Machine by its authority. If this number if lower than the number of items available, the Candy Machine is not ready and cannot be minted from.

    This field is irrelevant if the Candy Machine is using hidden settings.

  • Readonly isFullyLoaded: boolean

    Whether all items in the Candy Machine have been inserted by its authority.

    This field is irrelevant if the Candy Machine is using hidden settings.

  • Readonly endSettings: Option<CandyMachineV2EndSettings>

    An optional constraint defining when the Candy Machine will end. If this is null, the Candy Machine will end when there are no more items to mint from (i.e. itemsRemaining is 0).

  • Readonly hiddenSettings: Option<CandyMachineV2HiddenSettings>

    An optional setting that makes items in the Candy Machine hidden by providing a single URI for all minted NFTs and the hash of a file that maps mint number to actual NFT URIs.

    Hidden settings serve two purposes.

    • First, it allows the creation of larger drops (20k+), since the JSON metadata URIs are not stored on-chain for each item.
    • In turn, this also allows the creation of hide-and-reveal drops, where users discover which items they minted after the mint is complete.

    Once hidden settings are enabled, every minted NFT will have the same URI and the name will be created by appending the mint number (e.g., “#45”) to the specified name. The hash is expected to be a 32 character string corresponding to the hash of a cache file that has the mapping between a mint number and the actual metadata URI. This allows the order of the mint to be verified by others after the mint is complete.

    Since the metadata URIs are not on-chain, it is possible to create very large drops. The only caveat is that there is a need for an off-chain process to update the metadata for each item. This is important otherwise all items will have the same metadata.

  • Readonly whitelistMintSettings: Option<CandyMachineV2WhitelistMintSettings>

    Whitelist settings provide a variety of different use cases and revolve around the idea of using custom SPL tokens to offer special rights to token holders. How these SPL tokens are distributed is up to you.

    For example, you can offer a discount to token holders, you can allow token holders to mint NFTs before everyone else, or a combination of both.

  • Readonly gatekeeper: Option<CandyMachineV2Gatekeeper>

    Gatekeeper settings allow us to protect ourselves against malicious actors such as bots. Whilst the Candy Machine program itself has some protection mechanisms against bots, you may want to add extra protection to ensure only humand can mint from your project.

    To enable gatekeeper settings, you must provide the address of a Gatekeeper Network which usually encapsulates multiple gatekeeper providers and is responsible for validating the legitimacy of the minting actor.

  • Readonly creators: Creator[]

    Object that represents the creator of an asset. It contains its public key, its shares of the royalties in percent and whether or not the creator is verified for a given asset (i.e. they signed the asset).

Generated using TypeDoc