import { nftGateBeet } from '@metaplex-foundation/mpl-candy-guard';
import { GuardMintSettingsMissingError } from '../errors';
import { createSerializerFromBeet } from '../../../types';
/** @internal */
export const nftGateGuardManifest = {
    name: 'nftGate',
    settingsBytes: 32,
    settingsSerializer: createSerializerFromBeet(nftGateBeet),
    mintSettingsParser: ({ metaplex, mintSettings, payer, programs }) => {
        var _a;
        if (!mintSettings) {
            throw new GuardMintSettingsMissingError('nftGate');
        }
        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,
        });
        return {
            arguments: Buffer.from([]),
            remainingAccounts: [
                {
                    isSigner: false,
                    address: tokenAccount,
                    isWritable: false,
                },
                {
                    isSigner: false,
                    address: tokenMetadata,
                    isWritable: false,
                },
            ],
        };
    },
};
//# sourceMappingURL=nftGate.js.map