import { Buffer } from 'buffer';
import { PROGRAM_ID } from '@metaplex-solarti/mpl-token-metadata';
import { Pda, toBigNumber } from '../../types';
/**
 * @group Pdas
 * @deprecated Please use `metaplex.nfts().pdas().metadata(...)` instead.
 */
export const findMetadataPda = (mint, programId = PROGRAM_ID) => {
    return Pda.find(programId, [
        Buffer.from('metadata', 'utf8'),
        programId.toBuffer(),
        mint.toBuffer(),
    ]);
};
/**
 * @group Pdas
 * @deprecated Please use `metaplex.nfts().pdas().masterEdition(...)` instead.
 */
export const findMasterEditionV2Pda = (mint, programId = PROGRAM_ID) => {
    return Pda.find(programId, [
        Buffer.from('metadata', 'utf8'),
        programId.toBuffer(),
        mint.toBuffer(),
        Buffer.from('edition', 'utf8'),
    ]);
};
/**
 * @group Pdas
 * @deprecated Please use `metaplex.nfts().pdas().edition(...)` instead.
 */
export const findEditionPda = (mint, programId = PROGRAM_ID) => {
    return Pda.find(programId, [
        Buffer.from('metadata', 'utf8'),
        programId.toBuffer(),
        mint.toBuffer(),
        Buffer.from('edition', 'utf8'),
    ]);
};
/**
 * @group Pdas
 * @deprecated Please use `metaplex.nfts().pdas().editionMarker(...)` instead.
 */
export const findEditionMarkerPda = (mint, edition, programId = PROGRAM_ID) => {
    return Pda.find(programId, [
        Buffer.from('metadata', 'utf8'),
        programId.toBuffer(),
        mint.toBuffer(),
        Buffer.from('edition', 'utf8'),
        Buffer.from(edition.div(toBigNumber(248)).toString()),
    ]);
};
/**
 * @group Pdas
 * @deprecated Please use `metaplex.nfts().pdas().collectionAuthorityRecord(...)` instead.
 */
export const findCollectionAuthorityRecordPda = (mint, collectionAuthority, programId = PROGRAM_ID) => {
    return Pda.find(programId, [
        Buffer.from('metadata', 'utf8'),
        programId.toBuffer(),
        mint.toBuffer(),
        Buffer.from('collection_authority', 'utf8'),
        collectionAuthority.toBuffer(),
    ]);
};
/**
 * @group Pdas
 * @deprecated Please use `metaplex.nfts().pdas().useAuthorityRecord(...)` instead.
 */
export const findUseAuthorityRecordPda = (mint, useAuthority, programId = PROGRAM_ID) => {
    return Pda.find(programId, [
        Buffer.from('metadata', 'utf8'),
        programId.toBuffer(),
        mint.toBuffer(),
        Buffer.from('user', 'utf8'),
        useAuthority.toBuffer(),
    ]);
};
/**
 * @group Pdas
 * @deprecated Please use `metaplex.nfts().pdas().burner(...)` instead.
 */
export const findProgramAsBurnerPda = (programId = PROGRAM_ID) => {
    return Pda.find(programId, [
        Buffer.from('metadata', 'utf8'),
        programId.toBuffer(),
        Buffer.from('burn', 'utf8'),
    ]);
};
//# sourceMappingURL=pdas.js.map