import { Buffer } from 'buffer';
import { tokenPaymentBeet, } from '@metaplex-foundation/mpl-candy-guard';
import { createSerializerFromBeet, mapSerializer, token, } from '../../../types';
/** @internal */
export const tokenPaymentGuardManifest = {
    name: 'tokenPayment',
    settingsBytes: 72,
    settingsSerializer: mapSerializer(createSerializerFromBeet(tokenPaymentBeet), (settings) => (Object.assign(Object.assign({}, settings), { amount: token(settings.amount) })), (settings) => (Object.assign(Object.assign({}, settings), { amount: settings.amount.basisPoints }))),
    mintSettingsParser: ({ metaplex, settings, payer, programs }) => {
        const tokenAddress = metaplex.tokens().pdas().associatedTokenAccount({
            mint: settings.tokenMint,
            owner: payer.publicKey,
            programs,
        });
        return {
            arguments: Buffer.from([]),
            remainingAccounts: [
                {
                    isSigner: false,
                    address: tokenAddress,
                    isWritable: true,
                },
                {
                    isSigner: false,
                    address: settings.destinationAta,
                    isWritable: true,
                },
            ],
        };
    },
};
//# sourceMappingURL=tokenPayment.js.map