"use strict";
/**
 * This code was AUTOGENERATED using the kinobi library.
 * Please DO NOT EDIT THIS FILE, instead use visitors
 * to add features, then rerun kinobi to update it.
 *
 * @see https://github.com/metaplex-foundation/kinobi
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.burnEditionNft = exports.getBurnEditionNftInstructionDataSerializer = void 0;
const umi_1 = require("@metaplex-foundation/umi");
const serializers_1 = require("@metaplex-foundation/umi/serializers");
const shared_1 = require("../shared");
function getBurnEditionNftInstructionDataSerializer() {
    return (0, serializers_1.mapSerializer)((0, serializers_1.struct)([['discriminator', (0, serializers_1.u8)()]], {
        description: 'BurnEditionNftInstructionData',
    }), (value) => ({ ...value, discriminator: 37 }));
}
exports.getBurnEditionNftInstructionDataSerializer = getBurnEditionNftInstructionDataSerializer;
// Instruction.
function burnEditionNft(context, input) {
    // Program ID.
    const programId = context.programs.getPublicKey('mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s');
    // Accounts.
    const resolvedAccounts = {
        metadata: {
            index: 0,
            isWritable: true,
            value: input.metadata ?? null,
        },
        owner: {
            index: 1,
            isWritable: true,
            value: input.owner ?? null,
        },
        printEditionMint: {
            index: 2,
            isWritable: true,
            value: input.printEditionMint ?? null,
        },
        masterEditionMint: {
            index: 3,
            isWritable: false,
            value: input.masterEditionMint ?? null,
        },
        printEditionTokenAccount: {
            index: 4,
            isWritable: true,
            value: input.printEditionTokenAccount ?? null,
        },
        masterEditionTokenAccount: {
            index: 5,
            isWritable: false,
            value: input.masterEditionTokenAccount ?? null,
        },
        masterEditionAccount: {
            index: 6,
            isWritable: true,
            value: input.masterEditionAccount ?? null,
        },
        printEditionAccount: {
            index: 7,
            isWritable: true,
            value: input.printEditionAccount ?? null,
        },
        editionMarkerAccount: {
            index: 8,
            isWritable: true,
            value: input.editionMarkerAccount ?? null,
        },
        splTokenProgram: {
            index: 9,
            isWritable: false,
            value: input.splTokenProgram ?? null,
        },
    };
    // Default values.
    if (!resolvedAccounts.splTokenProgram.value) {
        resolvedAccounts.splTokenProgram.value = context.programs.getPublicKey('splToken', 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA');
        resolvedAccounts.splTokenProgram.isWritable = false;
    }
    // Accounts in order.
    const orderedAccounts = Object.values(resolvedAccounts).sort((a, b) => a.index - b.index);
    // Keys and Signers.
    const [keys, signers] = (0, shared_1.getAccountMetasAndSigners)(orderedAccounts, 'programId', programId);
    // Data.
    const data = getBurnEditionNftInstructionDataSerializer().serialize({});
    // Bytes Created On Chain.
    const bytesCreatedOnChain = 0;
    return (0, umi_1.transactionBuilder)([
        { instruction: { keys, programId, data }, signers, bytesCreatedOnChain },
    ]);
}
exports.burnEditionNft = burnEditionNft;
//# sourceMappingURL=burnEditionNft.js.map