import { nftBurnBeet } from '@metaplex-foundation/mpl-candy-guard';
import { GuardMintSettingsMissingError } from '../errors';
import { createSerializerFromBeet } from '../../../types';
/** @internal */
export const nftBurnGuardManifest = {
    name: 'nftBurn',
    settingsBytes: 32,
    settingsSerializer: createSerializerFromBeet(nftBurnBeet),
    mintSettingsParser: ({ metaplex, settings, mintSettings, payer, programs, }) => {
        var _a;
        if (!mintSettings) {
            throw new GuardMintSettingsMissingError('nftBurn');
        }
        const tokenAccount = (_a = mintSettings.tokenAccount) !== null && _a !== void 0 ? _a : metaplex.tokens().pdas().associatedTokenAccount({
            mint: mintSettings.mint,
            owner: payer.publicKey,
            programs,
        });
        const tokenMetadata = metaplex.nfts().pdas().metadata({
            mint: mintSettings.mint,
            programs,
        });
        const tokenEdition = metaplex.nfts().pdas().masterEdition({
            mint: mintSettings.mint,
            programs,
        });
        const mintCollectionMetadata = metaplex.nfts().pdas().metadata({
            mint: settings.requiredCollection,
            programs,
        });
        return {
            arguments: Buffer.from([]),
            remainingAccounts: [
                {
                    isSigner: false,
                    address: tokenAccount,
                    isWritable: true,
                },
                {
                    isSigner: false,
                    address: tokenMetadata,
                    isWritable: true,
                },
                {
                    isSigner: false,
                    address: tokenEdition,
                    isWritable: true,
                },
                {
                    isSigner: false,
                    address: mintSettings.mint,
                    isWritable: true,
                },
                {
                    isSigner: false,
                    address: mintCollectionMetadata,
                    isWritable: true,
                },
            ],
        };
    },
};
//# sourceMappingURL=nftBurn.js.map