1

I got an error when minting on candy machine on metaplex js sdk.

here is my setup:

    const u1 = Keypair.generate()

    // create collection
    const { nft: collection } = await metaplex
        .nfts()
        .create({
            isCollection: true,
            name: 'MYSOL BADGE COLLECTION',
            symbol: 'MYSBADGE',
            uri: `example.com`,
            sellerFeeBasisPoints: 333, // 3.33%
            mintAuthority: u1,
            updateAuthority: u1,
            tokenOwner: u1.publicKey,
            creators: [
                {
                    share: 100,
                    authority: u1,
                    address: u1.publicKey,
                },
            ],
        })

    // create candy machine
    const { candyMachine } = await metaplex.candyMachines().create({
        withoutCandyGuard: true,
        itemsAvailable: toBigNumber(5),
        sellerFeeBasisPoints: 333, // 3.33%
        authority: u1,
        symbol: 'MYSBADGECM',
        itemSettings: {
            type: 'configLines',
            isSequential: true,
            nameLength: 0,
            uriLength: 43,
            prefixName: "My NFT Project #$ID+1$",
            prefixUri: "https://arweave.net/",
        },
        collection: {
            address: collection.address,
            updateAuthority: u1,
        },
        guards: {
            startDate: {
                date: toDateTime(new Date('2021-10-01T00:00:00.000Z')),
            },
        }
    });

    // insert items
    const { response } = await metaplex.candyMachines().insertItems({
        candyMachine,
        items: [
            {  name: '', uri: `https://arweave.net/0` }
        ]
    })

    const { nft } = await metaplex.candyMachines().mint({
        candyMachine,
        collectionUpdateAuthority: u1.publicKey,
    })

and the above program produces an error like this:

    'Program 11111111111111111111111111111111 invoke [1]',
    'Program 11111111111111111111111111111111 success',
    'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [1]',
    'Program log: Instruction: InitializeMint',
    'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 2967 of 1000000 compute units',
    'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success',
    'Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL invoke [1]',
    'Program log: Create',
    'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [2]',
    'Program log: Instruction: GetAccountDataSize',
    'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 1622 of 991670 compute units',
    'Program return: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA pQAAAAAAAAA=',
    'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success',
    'Program 11111111111111111111111111111111 invoke [2]',
    'Program 11111111111111111111111111111111 success',
    'Program log: Initialize the associated token account',
    'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [2]',
    'Program log: Instruction: InitializeImmutableOwner',
    'Program log: Please upgrade to SPL Token 2022 for immutable owner support',
    'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 1405 of 985180 compute units',
    'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success',
    'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [2]',
    'Program log: Instruction: InitializeAccount3',
    'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 4241 of 981300 compute units',
    'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success',
    'Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL consumed 20257 of 997033 compute units',
    'Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL success',
    'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [1]',
    'Program log: Instruction: MintTo',
    'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 4536 of 976776 compute units',
    'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success',
    'Program CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR invoke [1]',
    'Program log: Instruction: Mint',
    'Program log: AnchorError thrown in src/instructions/mint.rs:255. Error Code: NotFullyLoaded. Error Number: 6020. Error Message: Not all config lines were added to the candy machine.',
    'Program CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR consumed 21205 of 972240 compute units',
    'Program CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR failed: custom program error: 0x1784'

1 Answer 1

1

I think you have to add all the items available, in this case 5 items. You should use insertItems for add the items.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.