import { tokenGateBeet } from '@metaplex-foundation/mpl-candy-guard';
import { createSerializerFromBeet, mapSerializer, token, } from '../../../types';
/** @internal */
export const tokenGateGuardManifest = {
    name: 'tokenGate',
    settingsBytes: 40,
    settingsSerializer: mapSerializer(createSerializerFromBeet(tokenGateBeet), (settings) => (Object.assign(Object.assign({}, settings), { amount: token(settings.amount) })), (settings) => (Object.assign(Object.assign({}, settings), { amount: settings.amount.basisPoints }))),
    mintSettingsParser: ({ metaplex, settings, mintSettings, payer, programs, }) => {
        var _a;
        const tokenAccount = (_a = mintSettings === null || mintSettings === void 0 ? void 0 : mintSettings.tokenAccount) !== null && _a !== void 0 ? _a : metaplex.tokens().pdas().associatedTokenAccount({
            mint: settings.mint,
            owner: payer.publicKey,
            programs,
        });
        return {
            arguments: Buffer.from([]),
            remainingAccounts: [
                {
                    isSigner: false,
                    address: tokenAccount,
                    isWritable: false,
                },
            ],
        };
    },
};
//# sourceMappingURL=tokenGate.js.map