{"version":3,"file":"index.cjs","sources":["../../../../../src/index.ts"],"sourcesContent":["import type {\n    Commitment,\n    PublicKey,\n    Signer,\n    ConfirmOptions,\n    TransactionInstruction,\n    TransactionSignature,\n} from '@solana/web3.js';\nimport type { Rpc } from '@lightprotocol/stateless.js';\nimport type {\n    AccountInterface as MintAccountInterface,\n    InterfaceOptions,\n} from './v3';\nimport { getAtaInterface as _mintGetAtaInterface } from './v3';\n\nexport * from './actions';\nexport * from './utils';\nexport * from './constants';\nexport * from './idl';\nexport * from './layout';\nexport * from './program';\nexport { CompressedTokenProgram as LightTokenProgram } from './program';\nexport * from './types';\nimport {\n    createLoadAtaInstructions as _createLoadAtaInstructions,\n    loadAta as _loadAta,\n    selectInputsForAmount,\n} from './v3/actions/load-ata';\nimport { getMintInterface } from './v3/get-mint-interface';\n\nexport { selectInputsForAmount };\n\nexport {\n    estimateTransactionSize,\n    MAX_TRANSACTION_SIZE,\n    MAX_COMBINED_BATCH_BYTES,\n    MAX_LOAD_ONLY_BATCH_BYTES,\n} from './v3/utils/estimate-tx-size';\n\n// Export mint module with explicit naming to avoid conflicts\nexport {\n    // Instructions\n    createMintInstruction,\n    createTokenMetadata,\n    createAssociatedLightTokenAccountInstruction,\n    createAssociatedLightTokenAccountIdempotentInstruction,\n    createAssociatedTokenAccountInterfaceInstruction,\n    createAssociatedTokenAccountInterfaceIdempotentInstruction,\n    createAtaInterfaceIdempotentInstruction,\n    createMintToInstruction,\n    createMintToCompressedInstruction,\n    createMintToInterfaceInstruction,\n    createUpdateMintAuthorityInstruction,\n    createUpdateFreezeAuthorityInstruction,\n    createUpdateMetadataFieldInstruction,\n    createUpdateMetadataAuthorityInstruction,\n    createRemoveMetadataKeyInstruction,\n    createWrapInstruction,\n    createUnwrapInstruction,\n    createUnwrapInstructions,\n    createLightTokenFreezeAccountInstruction,\n    createLightTokenThawAccountInstruction,\n    createLightTokenTransferInstruction,\n    createLightTokenTransferCheckedInstruction,\n    createLightTokenApproveInstruction,\n    createLightTokenRevokeInstruction,\n    // Types\n    TokenMetadataInstructionData,\n    CompressibleConfig,\n    LightTokenConfig,\n    CreateAssociatedLightTokenAccountParams,\n    // Constants for rent sponsor\n    DEFAULT_COMPRESSIBLE_CONFIG,\n    // Actions\n    createMintInterface,\n    createAtaInterface,\n    createAtaInterfaceIdempotent,\n    getAssociatedTokenAddressInterface,\n    getOrCreateAtaInterface,\n    transferInterface,\n    transferToAccountInterface,\n    createTransferInterfaceInstructions,\n    createTransferToAccountInterfaceInstructions,\n    sliceLast,\n    approveInterface,\n    createApproveInterfaceInstructions,\n    revokeInterface,\n    createRevokeInterfaceInstructions,\n    wrap,\n    mintTo as mintToLightToken,\n    mintToCompressed,\n    mintToInterface,\n    updateMintAuthority,\n    updateFreezeAuthority,\n    updateMetadataField,\n    updateMetadataAuthority,\n    removeMetadataKey,\n    // Action types\n    InterfaceOptions,\n    // Helpers\n    getMintInterface,\n    unpackMintInterface,\n    unpackMintData,\n    MintInterface,\n    getAccountInterface,\n    Account,\n    AccountState,\n    ParsedTokenAccount as ParsedTokenAccountInterface,\n    parseLightTokenHot,\n    parseLightTokenCold,\n    toAccountInfo,\n    convertTokenDataToAccount,\n    // Types\n    AccountInterface,\n    TokenAccountSource,\n    // Serde\n    BaseMint,\n    MintContext,\n    MintExtension,\n    TokenMetadata,\n    CompressedMint,\n    deserializeMint,\n    serializeMint,\n    decodeTokenMetadata,\n    encodeTokenMetadata,\n    extractTokenMetadata,\n    ExtensionType,\n    // Metadata formatting (for use with any uploader)\n    toOffChainMetadataJson,\n    OffChainTokenMetadata,\n    OffChainTokenMetadataJson,\n} from './v3';\n\n/**\n * Retrieve associated token account for a given owner and mint.\n *\n * @param rpc         RPC connection\n * @param ata         Associated token address\n * @param owner       Owner public key\n * @param mint        Mint public key\n * @param commitment  Optional commitment level\n * @param programId   Optional program ID\n * @returns AccountInterface with ATA metadata\n */\nexport async function getAtaInterface(\n    rpc: Rpc,\n    ata: PublicKey,\n    owner: PublicKey,\n    mint: PublicKey,\n    commitment?: Commitment,\n    programId?: PublicKey,\n): Promise<MintAccountInterface> {\n    return _mintGetAtaInterface(rpc, ata, owner, mint, commitment, programId);\n}\n\n/**\n * Create instruction batches for loading token balances into an ATA.\n * Returns batches of instructions, each batch is one transaction.\n *\n * @param rpc               RPC connection\n * @param ata               Associated token address\n * @param owner             Owner public key\n * @param mint              Mint public key\n * @param payer             Fee payer (defaults to owner)\n * @param options           Optional load options\n * @returns Instruction batches - each inner array is one transaction\n */\nexport async function createLoadAtaInstructions(\n    rpc: Rpc,\n    ata: PublicKey,\n    owner: PublicKey,\n    mint: PublicKey,\n    payer?: PublicKey,\n    options?: InterfaceOptions,\n): Promise<TransactionInstruction[][]> {\n    const mintInterface = await getMintInterface(rpc, mint);\n    return _createLoadAtaInstructions(\n        rpc,\n        ata,\n        owner,\n        mint,\n        mintInterface.mint.decimals,\n        payer,\n        options,\n    );\n}\n\n/**\n * Load token balances into a light-token ATA.\n *\n * @param rpc               RPC connection\n * @param ata               Associated token address\n * @param owner             Owner of the tokens (signer)\n * @param mint              Mint public key\n * @param payer             Fee payer (signer, defaults to owner)\n * @param confirmOptions    Optional confirm options\n * @param interfaceOptions  Optional interface options\n * @returns Transaction signature, or null if nothing to load\n */\nexport async function loadAta(\n    rpc: Rpc,\n    ata: PublicKey,\n    owner: Signer,\n    mint: PublicKey,\n    payer?: Signer,\n    confirmOptions?: ConfirmOptions,\n    interfaceOptions?: InterfaceOptions,\n    decimals?: number,\n): Promise<TransactionSignature | null> {\n    return _loadAta(\n        rpc,\n        ata,\n        owner,\n        mint,\n        payer,\n        confirmOptions,\n        interfaceOptions,\n        decimals,\n    );\n}\n"],"names":["async","rpc","ata","owner","mint","payer","options","mintInterface","getMintInterface","_createLoadAtaInstructions","decimals","commitment","programId","_mintGetAtaInterface","confirmOptions","interfaceOptions","_loadAta","loadAta"],"mappings":"27VAuKOA,eACHC,EACAC,EACAC,EACAC,EACAC,EACAC,GAEA,MAAMC,QAAsBC,EAAAA,iBAAiBP,EAAKG,GAClD,OAAOK,4BACHR,EACAC,EACAC,EACAC,EACAG,EAAcH,KAAKM,SACnBL,EACAC,EAER,0BAzCON,eACHC,EACAC,EACAC,EACAC,EACAO,EACAC,GAEA,OAAOC,EAAAA,gBAAqBZ,EAAKC,EAAKC,EAAOC,EAAMO,EAAYC,EACnE,kBA8COZ,eACHC,EACAC,EACAC,EACAC,EACAC,EACAS,EACAC,EACAL,GAEA,OAAOM,EAAQC,QACXhB,EACAC,EACAC,EACAC,EACAC,EACAS,EACAC,EACAL,EAER"}