@lightprotocol/compressed-token 0.23.0-beta.10 → 0.23.0-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- import{ComputeBudgetProgram as a}from"@solana/web3.js";import{assertBetaEnabled as e,dedupeSigner as s,buildAndSignTx as c,sendAndConfirmTx as d,LIGHT_TOKEN_PROGRAM_ID as l}from"@lightprotocol/stateless.js";import{a as b,z as m,O,g as M,J as L,c as N,l as g,m as K,L as z,bP as J,bQ as ea,N as ta}from"../types-e_5LjLhR.js";export{b0 as ADD_TOKEN_POOL_DISCRIMINATOR,a_ as APPROVE_DISCRIMINATOR,av as Action,b2 as BASE_RENT_PER_EPOCH,aX as BATCH_COMPRESS_DISCRIMINATOR,bS as COMPRESSED_MINT_SEED,b8 as COMPRESSIBLE_LIGHT_TOKEN_ACCOUNT_SIZE,ba as COMPRESSIBLE_LIGHT_TOKEN_RENT_PER_EPOCH,b5 as COMPRESSION_COST,b6 as COMPRESSION_INCENTIVE,aZ as COMPRESS_SPL_TOKEN_ACCOUNT_DISCRIMINATOR,aT as CPI_AUTHORITY_SEED,aV as CREATE_TOKEN_POOL_DISCRIMINATOR,bB as CompressedTokenInstructionDataApproveLayout,bC as CompressedTokenInstructionDataRevokeLayout,bh as CompressedTokenInstructionDataTransferLayout,C as CompressedTokenProgram,bg as CpiContextLayout,F as DEFAULT_COMPRESSIBLE_CONFIG,bb as DEFAULT_PREPAY_EPOCHS,bc as DEFAULT_WRITE_TOP_UP,bf as DelegatedTransferLayout,aE as ERROR_MIXED_TREE_TYPES,aD as ERROR_NO_ACCOUNTS_FOUND,a8 as ExtensionType,be as IDL,aP as LIGHT_TOKEN_CONFIG,aQ as LIGHT_TOKEN_RENT_SPONSOR,b1 as MAX_TOP_UP,aW as MINT_TO_DISCRIMINATOR,aS as POOL_SEED,b3 as RENT_PER_BYTE_PER_EPOCH,a$ as REVOKE_DISCRIMINATOR,b4 as SLOTS_PER_RENT_EPOCH,aU as SPL_TOKEN_MINT_RENT_EXEMPT_BALANCE,b7 as TOTAL_COMPRESSION_COST,aY as TRANSFER_DISCRIMINATOR,aR as TokenDataVersion,ah as addSplInterfaces,bu as addTokenPoolAccountsLayout,ai as addTokenPools,aa as approve,bx as approveAccountsLayout,ab as approveAndMintTo,bj as batchCompressLayout,bd as calculateFeePayerCostAtCreation,aO as checkMint,at as checkSplInterfaceInfo,az as checkTokenPoolInfo,ac as compress,ad as compressSplTokenAccount,bk as compressSplTokenAccountInstructionDataLayout,a2 as convertTokenDataToAccount,j as createAssociatedLightTokenAccountIdempotentInstruction,i as createAssociatedLightTokenAccountInstruction,k as createAssociatedTokenAccountInterfaceInstruction,H as createAtaInterface,I as createAtaInterfaceIdempotent,n as createAtaInterfaceIdempotentInstruction,bM as createDecompressOutputState,A as createLightTokenFreezeAccountInstruction,B as createLightTokenThawAccountInstruction,E as createLightTokenTransferCheckedInstruction,D as createLightTokenTransferInstruction,ae as createMint,f as createMintInstruction,G as createMintInterface,p as createMintToCompressedInstruction,o as createMintToInstruction,q as createMintToInterfaceInstruction,w as createRemoveMetadataKeyInstruction,af as createSplInterface,h as createTokenMetadata,ag as createTokenPool,bt as createTokenPoolAccountsLayout,aj as createTokenProgramLookupTable,bL as createTransferOutputState,y as createUnwrapInstruction,t as createUpdateFreezeAuthorityInstruction,v as createUpdateMetadataAuthorityInstruction,u as createUpdateMetadataFieldInstruction,r as createUpdateMintAuthorityInstruction,x as createWrapInstruction,bE as decodeApproveInstructionData,bo as decodeBatchCompressInstructionData,bq as decodeCompressSplTokenAccountInstructionData,bm as decodeMintToInstructionData,bG as decodeRevokeInstructionData,a5 as decodeTokenMetadata,bs as decodeTransferInstructionData,ak as decompress,aq as decompressDelegated,bR as deriveCMintAddress,as as deriveSplInterfaceInfo,ay as deriveTokenPoolInfo,a3 as deserializeMint,bD as encodeApproveInstructionData,bn as encodeBatchCompressInstructionData,bp as encodeCompressSplTokenAccountInstructionData,bl as encodeMintToInstructionData,bF as encodeRevokeInstructionData,a6 as encodeTokenMetadata,br as encodeTransferInstructionData,a7 as extractTokenMetadata,bT as findMintAddress,bz as freezeAccountsLayout,_ as getAccountInterface,bV as getAssociatedLightTokenAddress,bU as getAssociatedLightTokenAddressAndBump,au as getSplInterfaceInfos,aA as getTokenPoolInfos,aF as groupAccountsByTreeType,bN as isSingleSplInterfaceInfo,bO as isSingleTokenPoolInfo,al as mergeTokenAccounts,am as mintTo,bv as mintToAccountsLayout,R as mintToCompressed,S as mintToInterface,bi as mintToLayout,Q as mintToLightToken,aN as packCompressedTokenAccounts,a0 as parseLightTokenCold,$ as parseLightTokenHot,bK as parseMaybeDelegatedTransfer,bJ as parseTokenData,X as removeMetadataKey,b9 as rentPerEpoch,an as revoke,by as revokeAccountsLayout,aG as selectAccountsByPreferredTreeType,aI as selectMinCompressedTokenAccountsForDecompression,aJ as selectMinCompressedTokenAccountsForTransfer,aK as selectMinCompressedTokenAccountsForTransferOrPartial,aL as selectSmartCompressedTokenAccountsForTransfer,aM as selectSmartCompressedTokenAccountsForTransferOrPartial,aw as selectSplInterfaceInfo,ax as selectSplInterfaceInfosForDecompression,aH as selectTokenAccountsForApprove,aB as selectTokenPoolInfo,aC as selectTokenPoolInfosForDecompression,a4 as serializeMint,bH as sumUpTokenAmount,bA as thawAccountsLayout,a1 as toAccountInfo,a9 as toOffChainMetadataJson,ar as toTokenPoolInfo,ao as transfer,bw as transferAccountsLayout,ap as transferDelegated,Z as unpackMintData,Y as unpackMintInterface,U as updateFreezeAuthority,W as updateMetadataAuthority,V as updateMetadataField,T as updateMintAuthority,bI as validateSameTokenOwner,P as wrap}from"../types-e_5LjLhR.js";export{AccountState}from"@solana/spl-token";import"@coral-xyz/borsh";async function sa(a,e,t,s,o,n){return M(a,e,t,s,o,n,1)}function oa(a,e,t=0,s=l,o){if(!s.equals(l))throw new Error("Please derive the unified ATA from the light-token program; balances across SPL, T22, and light-token are unified under the canonical light-token ATA.");return L(a,e,t,s,o)}async function na(a,e,t,s,o,n){const r=await b(a,s);return N(a,e,t,s,r.mint.decimals,o,n,1)}async function ra(e,t,s,o,n,r,i,u){n??=s;const T=await g(e,t,s,o,n,r,i,1,u);if(null===T&&!await e.getAccountInfo(t)){const i=K(n.publicKey,t,s.publicKey,o,l),{blockhash:u}=await e.getLatestBlockhash(),T=c([a.setComputeUnitLimit({units:3e4}),i],n,u,n.publicKey.equals(s.publicKey)?[]:[s]);return d(e,T,r)}return T}async function ca(a,e,t,s,o,n,r,c,i,u){return z(a,e,t,s,o,n,r,void 0,c,i,1,u)}async function ia(a,e,t,s,o=0,n,r){return J(a,e,t,s,o,n,r,l,ea(l),1)}async function ua(a,e,t,s,o,n,r){const c=await b(a,t);return ta(a,e,t,s,o,n,c.mint.decimals,{...r,wrap:1})}async function Ta(a,e,t,s,o,n,r,c){const i=await b(a,s);return m(a,e,t,s,i.mint.decimals,o,n,r,void 0,c,0)}async function Ia(a,t,o,n,r,i,u,T,I){return async function(a,t,o,n,r,i,u,T,I,p,A=0){e();const l=p??(await b(a,r)).mint.decimals,f=await m(a,o,n.publicKey,r,l,i,t.publicKey,u,T,void 0,A),k=s(t,[n]),{rest:E,last:_}=O(f);await Promise.all(E.map((async e=>{const{blockhash:s}=await a.getLatestBlockhash(),o=c(e,t,s,k);return d(a,o,I)})));const{blockhash:S}=await a.getLatestBlockhash(),C=c(_,t,S,k);return d(a,C,I)}(a,t,o,n,r,i,u,void 0,T,I,0)}export{K as createAssociatedTokenAccountInterfaceIdempotentInstruction,na as createLoadAtaInstructions,ua as createTransferInterfaceInstructions,Ta as createUnwrapInstructions,oa as getAssociatedTokenAddressInterface,sa as getAtaInterface,b as getMintInterface,ia as getOrCreateAtaInterface,ra as loadAta,O as sliceLast,ca as transferInterface,Ia as unwrap};
1
+ import{ComputeBudgetProgram as a}from"@solana/web3.js";import{assertBetaEnabled as e,dedupeSigner as s,buildAndSignTx as c,sendAndConfirmTx as T,LIGHT_TOKEN_PROGRAM_ID as d}from"@lightprotocol/stateless.js";import{a as l,z as b,S as m,g as O,L as S,c as P,l as R,m as M,O as L,P as N,bX as g,bY as U,Q as z,R as V,T as W,U as Q,V as ea,W as ta}from"../types-CicHpkHU.js";export{b8 as ADD_TOKEN_POOL_DISCRIMINATOR,b6 as APPROVE_DISCRIMINATOR,aD as Action,ba as BASE_RENT_PER_EPOCH,b3 as BATCH_COMPRESS_DISCRIMINATOR,b_ as COMPRESSED_MINT_SEED,bg as COMPRESSIBLE_LIGHT_TOKEN_ACCOUNT_SIZE,bi as COMPRESSIBLE_LIGHT_TOKEN_RENT_PER_EPOCH,bd as COMPRESSION_COST,be as COMPRESSION_INCENTIVE,b5 as COMPRESS_SPL_TOKEN_ACCOUNT_DISCRIMINATOR,a$ as CPI_AUTHORITY_SEED,b1 as CREATE_TOKEN_POOL_DISCRIMINATOR,bJ as CompressedTokenInstructionDataApproveLayout,bK as CompressedTokenInstructionDataRevokeLayout,bp as CompressedTokenInstructionDataTransferLayout,C as CompressedTokenProgram,bo as CpiContextLayout,H as DEFAULT_COMPRESSIBLE_CONFIG,bj as DEFAULT_PREPAY_EPOCHS,bk as DEFAULT_WRITE_TOP_UP,bn as DelegatedTransferLayout,aM as ERROR_MIXED_TREE_TYPES,aL as ERROR_NO_ACCOUNTS_FOUND,ag as ExtensionType,bm as IDL,aX as LIGHT_TOKEN_CONFIG,aY as LIGHT_TOKEN_RENT_SPONSOR,b9 as MAX_TOP_UP,b2 as MINT_TO_DISCRIMINATOR,a_ as POOL_SEED,bb as RENT_PER_BYTE_PER_EPOCH,b7 as REVOKE_DISCRIMINATOR,bc as SLOTS_PER_RENT_EPOCH,b0 as SPL_TOKEN_MINT_RENT_EXEMPT_BALANCE,bf as TOTAL_COMPRESSION_COST,b4 as TRANSFER_DISCRIMINATOR,aZ as TokenDataVersion,ap as addSplInterfaces,bC as addTokenPoolAccountsLayout,aq as addTokenPools,ai as approve,bF as approveAccountsLayout,aj as approveAndMintTo,br as batchCompressLayout,bl as calculateFeePayerCostAtCreation,aW as checkMint,aB as checkSplInterfaceInfo,aH as checkTokenPoolInfo,ak as compress,al as compressSplTokenAccount,bs as compressSplTokenAccountInstructionDataLayout,aa as convertTokenDataToAccount,j as createAssociatedLightTokenAccountIdempotentInstruction,i as createAssociatedLightTokenAccountInstruction,k as createAssociatedTokenAccountInterfaceInstruction,J as createAtaInterface,K as createAtaInterfaceIdempotent,n as createAtaInterfaceIdempotentInstruction,bU as createDecompressOutputState,F as createLightTokenApproveInstruction,A as createLightTokenFreezeAccountInstruction,G as createLightTokenRevokeInstruction,B as createLightTokenThawAccountInstruction,E as createLightTokenTransferCheckedInstruction,D as createLightTokenTransferInstruction,am as createMint,f as createMintInstruction,I as createMintInterface,p as createMintToCompressedInstruction,o as createMintToInstruction,q as createMintToInterfaceInstruction,w as createRemoveMetadataKeyInstruction,an as createSplInterface,h as createTokenMetadata,ao as createTokenPool,bB as createTokenPoolAccountsLayout,ar as createTokenProgramLookupTable,bT as createTransferOutputState,y as createUnwrapInstruction,t as createUpdateFreezeAuthorityInstruction,v as createUpdateMetadataAuthorityInstruction,u as createUpdateMetadataFieldInstruction,r as createUpdateMintAuthorityInstruction,x as createWrapInstruction,bM as decodeApproveInstructionData,bw as decodeBatchCompressInstructionData,by as decodeCompressSplTokenAccountInstructionData,bu as decodeMintToInstructionData,bO as decodeRevokeInstructionData,ad as decodeTokenMetadata,bA as decodeTransferInstructionData,as as decompress,ay as decompressDelegated,bZ as deriveCMintAddress,aA as deriveSplInterfaceInfo,aG as deriveTokenPoolInfo,ab as deserializeMint,bL as encodeApproveInstructionData,bv as encodeBatchCompressInstructionData,bx as encodeCompressSplTokenAccountInstructionData,bt as encodeMintToInstructionData,bN as encodeRevokeInstructionData,ae as encodeTokenMetadata,bz as encodeTransferInstructionData,af as extractTokenMetadata,b$ as findMintAddress,bH as freezeAccountsLayout,a6 as getAccountInterface,c1 as getAssociatedLightTokenAddress,c0 as getAssociatedLightTokenAddressAndBump,aC as getSplInterfaceInfos,aI as getTokenPoolInfos,aN as groupAccountsByTreeType,bV as isSingleSplInterfaceInfo,bW as isSingleTokenPoolInfo,at as mergeTokenAccounts,au as mintTo,bD as mintToAccountsLayout,Z as mintToCompressed,_ as mintToInterface,bq as mintToLayout,Y as mintToLightToken,aV as packCompressedTokenAccounts,a8 as parseLightTokenCold,a7 as parseLightTokenHot,bS as parseMaybeDelegatedTransfer,bR as parseTokenData,a3 as removeMetadataKey,bh as rentPerEpoch,av as revoke,bG as revokeAccountsLayout,aO as selectAccountsByPreferredTreeType,aQ as selectMinCompressedTokenAccountsForDecompression,aR as selectMinCompressedTokenAccountsForTransfer,aS as selectMinCompressedTokenAccountsForTransferOrPartial,aT as selectSmartCompressedTokenAccountsForTransfer,aU as selectSmartCompressedTokenAccountsForTransferOrPartial,aE as selectSplInterfaceInfo,aF as selectSplInterfaceInfosForDecompression,aP as selectTokenAccountsForApprove,aJ as selectTokenPoolInfo,aK as selectTokenPoolInfosForDecompression,ac as serializeMint,bP as sumUpTokenAmount,bI as thawAccountsLayout,a9 as toAccountInfo,ah as toOffChainMetadataJson,az as toTokenPoolInfo,aw as transfer,bE as transferAccountsLayout,ax as transferDelegated,a5 as unpackMintData,a4 as unpackMintInterface,a0 as updateFreezeAuthority,a2 as updateMetadataAuthority,a1 as updateMetadataField,$ as updateMintAuthority,bQ as validateSameTokenOwner,X as wrap}from"../types-CicHpkHU.js";export{AccountState}from"@solana/spl-token";import"@coral-xyz/borsh";async function sa(a,e,t,s,n,o){return O(a,e,t,s,n,o,1)}function na(a,e,t=0,s=d,n){if(!s.equals(d))throw new Error("Please derive the unified ATA from the light-token program; balances across SPL, T22, and light-token are unified under the canonical light-token ATA.");return S(a,e,t,s,n)}async function oa(a,e,t,s,n,o){const c=await l(a,s);return P(a,e,t,s,c.mint.decimals,n,o,1)}async function ca(e,t,s,n,o,r,i,u){o??=s;const I=await R(e,t,s,n,o,r,i,1,u);if(null===I&&!await e.getAccountInfo(t)){const i=M(o.publicKey,t,s.publicKey,n,d),{blockhash:u}=await e.getLatestBlockhash(),I=c([a.setComputeUnitLimit({units:3e4}),i],o,u,o.publicKey.equals(s.publicKey)?[]:[s]);return T(e,I,r)}return I}async function ra(a,e,t,s,n,o,c,r,i,u){return L(a,e,t,s,n,o,c,void 0,r,i,1,u)}async function ia(a,e,t,s,n,o,c,r,i,u){return N(a,e,t,s,n,o,c,void 0,r,i,1,u)}async function ua(a,e,t,s,n=0,o,c){return g(a,e,t,s,n,o,c,d,U(d),1)}async function Ta(a,e,t,s,n,o,c){const r=await l(a,t);return z(a,e,t,s,n,o,r.mint.decimals,{...c,wrap:1})}async function Ia(a,e,t,s,n,o,c){const r=await l(a,t);return V(a,e,t,s,n,o,r.mint.decimals,{...c,wrap:1})}async function da(a,e,t,s,n,o,c,r){const i=await l(a,s);return b(a,e,t,s,i.mint.decimals,n,o,c,void 0,r,0)}async function pa(a,t,n,o,r,i,u,I,d){return async function(a,t,n,o,r,i,u,I,d,p,A=0){e();const f=p??(await l(a,r)).mint.decimals,k=await b(a,n,o.publicKey,r,f,i,t.publicKey,u,I,void 0,A),E=s(t,[o]),{rest:_,last:O}=m(k);await Promise.all(_.map((async e=>{const{blockhash:s}=await a.getLatestBlockhash(),n=c(e,t,s,E);return T(a,n,d)})));const{blockhash:S}=await a.getLatestBlockhash(),C=c(O,t,S,E);return T(a,C,d)}(a,t,n,o,r,i,u,void 0,I,d,0)}async function la(a,e,t,s,n,o,c,r,i,u){return W(a,e,t,s,n,o,c,r,void 0,1,i,u)}async function Aa(a,e,t,s,n,o,c,r,i){const u=r??(await l(a,t)).mint.decimals;return Q(a,e,t,s,n,o,c,u,void 0,1,i)}async function fa(a,e,t,s,n,o,c,r){return ea(a,e,t,s,n,o,void 0,1,c,r)}async function ka(a,e,t,s,n,o,c){const r=o??(await l(a,t)).mint.decimals;return ta(a,e,t,s,n,r,void 0,1,c)}export{la as approveInterface,Aa as createApproveInterfaceInstructions,M as createAssociatedTokenAccountInterfaceIdempotentInstruction,oa as createLoadAtaInstructions,ka as createRevokeInterfaceInstructions,Ta as createTransferInterfaceInstructions,Ia as createTransferToAccountInterfaceInstructions,da as createUnwrapInstructions,na as getAssociatedTokenAddressInterface,sa as getAtaInterface,l as getMintInterface,ua as getOrCreateAtaInterface,ca as loadAta,fa as revokeInterface,m as sliceLast,ra as transferInterface,ia as transferToAccountInterface,pa as unwrap};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../src/v3/unified/index.ts","../../../../../../src/v3/actions/unwrap.ts"],"sourcesContent":["/**\n * Exports for @lightprotocol/compressed-token/unified\n *\n * Import from `/unified` to get a single unified associated token account for SPL/T22 and light-token\n * mints.\n */\nimport {\n PublicKey,\n Signer,\n ConfirmOptions,\n Commitment,\n ComputeBudgetProgram,\n TransactionInstruction,\n} from '@solana/web3.js';\nimport {\n Rpc,\n LIGHT_TOKEN_PROGRAM_ID,\n buildAndSignTx,\n sendAndConfirmTx,\n} from '@lightprotocol/stateless.js';\nimport BN from 'bn.js';\n\nimport {\n getAtaInterface as _getAtaInterface,\n AccountInterface,\n} from '../get-account-interface';\nimport { getAssociatedTokenAddressInterface as _getAssociatedTokenAddressInterface } from '../get-associated-token-address-interface';\nimport {\n createLoadAtaInstructions as _createLoadAtaInstructions,\n loadAta as _loadAta,\n} from '../actions/load-ata';\nimport { createAssociatedTokenAccountInterfaceIdempotentInstruction } from '../instructions/create-ata-interface';\nimport {\n transferInterface as _transferInterface,\n createTransferInterfaceInstructions as _createTransferInterfaceInstructions,\n} from '../actions/transfer-interface';\nimport type { TransferOptions as _TransferOptions } from '../actions/transfer-interface';\nimport { _getOrCreateAtaInterface } from '../actions/get-or-create-ata-interface';\nimport {\n createUnwrapInstructions as _createUnwrapInstructions,\n unwrap as _unwrap,\n} from '../actions/unwrap';\nimport { SplInterfaceInfo } from '../../utils/get-token-pool-infos';\nimport { getAtaProgramId } from '../ata-utils';\nimport { InterfaceOptions } from '..';\nimport { getMintInterface } from '../get-mint-interface';\n\n/**\n * Get associated token account with unified balance\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 (omit for unified behavior)\n * @returns AccountInterface with aggregated balance from all sources\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<AccountInterface> {\n return _getAtaInterface(rpc, ata, owner, mint, commitment, programId, true);\n}\n\n/**\n * Derive the canonical token associated token account for SPL/T22/light-token in the unified path.\n *\n * Enforces LIGHT_TOKEN_PROGRAM_ID.\n *\n * @param mint Mint public key\n * @param owner Owner public key\n * @param allowOwnerOffCurve Allow owner to be a PDA. Default false.\n * @param programId Token program ID. Default light-token.\n * @param associatedTokenProgramId Associated token program ID. Default\n * auto-detected.\n * @returns Associated token address.\n */\nexport function getAssociatedTokenAddressInterface(\n mint: PublicKey,\n owner: PublicKey,\n allowOwnerOffCurve = false,\n programId: PublicKey = LIGHT_TOKEN_PROGRAM_ID,\n associatedTokenProgramId?: PublicKey,\n): PublicKey {\n if (!programId.equals(LIGHT_TOKEN_PROGRAM_ID)) {\n throw new Error(\n 'Please derive the unified ATA from the light-token program; balances across SPL, T22, and light-token are unified under the canonical light-token ATA.',\n );\n }\n\n return _getAssociatedTokenAddressInterface(\n mint,\n owner,\n allowOwnerOffCurve,\n programId,\n associatedTokenProgramId,\n );\n}\n\n/**\n * Create instruction batches for loading ALL token balances into a light-token associated token account.\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 interface 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 true,\n );\n}\n\n/**\n * Load all token balances into the light-token associated token account.\n *\n * Wraps SPL/Token-2022 balances and decompresses compressed light-tokens\n * into the on-chain light-token associated token account. If no balances exist and the associated token account doesn't\n * exist, creates an empty ATA (idempotent).\n *\n * @param rpc RPC connection\n * @param ata Associated token address (light-token)\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 ATA exists and 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) {\n payer ??= owner;\n\n const signature = await _loadAta(\n rpc,\n ata,\n owner,\n mint,\n payer,\n confirmOptions,\n interfaceOptions,\n true,\n decimals,\n );\n\n // If nothing to load, ensure ATA exists (idempotent).\n if (signature === null) {\n const accountInfo = await rpc.getAccountInfo(ata);\n if (!accountInfo) {\n const ix =\n createAssociatedTokenAccountInterfaceIdempotentInstruction(\n payer.publicKey,\n ata,\n owner.publicKey,\n mint,\n LIGHT_TOKEN_PROGRAM_ID,\n );\n const { blockhash } = await rpc.getLatestBlockhash();\n const tx = buildAndSignTx(\n [\n ComputeBudgetProgram.setComputeUnitLimit({ units: 30_000 }),\n ix,\n ],\n payer,\n blockhash,\n payer.publicKey.equals(owner.publicKey) ? [] : [owner],\n );\n return sendAndConfirmTx(rpc, tx, confirmOptions);\n }\n }\n\n return signature;\n}\n\n/**\n * Transfer tokens using the unified ata interface.\n *\n * Destination associated token account must exist. Automatically wraps SPL/T22 to light-token associated token account.\n *\n * @param rpc RPC connection\n * @param payer Fee payer (signer)\n * @param source Source light-token associated token account address\n * @param mint Mint address\n * @param destination Destination token account address (must exist; derive via getAssociatedTokenAddressInterface)\n * @param owner Source owner (signer)\n * @param amount Amount to transfer\n * @param confirmOptions Optional confirm options\n * @param options Optional interface options\n * @returns Transaction signature\n */\nexport async function transferInterface(\n rpc: Rpc,\n payer: Signer,\n source: PublicKey,\n mint: PublicKey,\n destination: PublicKey,\n owner: Signer,\n amount: number | bigint | BN,\n confirmOptions?: ConfirmOptions,\n options?: InterfaceOptions,\n decimals?: number,\n) {\n return _transferInterface(\n rpc,\n payer,\n source,\n mint,\n destination,\n owner,\n amount,\n undefined, // programId: use default LIGHT_TOKEN_PROGRAM_ID\n confirmOptions,\n options,\n true, // wrap=true for unified\n decimals,\n );\n}\n\n/**\n * Get or create light-token ATA with unified balance detection and auto-loading.\n *\n * Enforces LIGHT_TOKEN_PROGRAM_ID. Aggregates balances from:\n * - light-token associated token account (hot balance)\n * - compressed light-token accounts (cold balance)\n * - SPL token accounts (for unified wrapping)\n * - Token-2022 accounts (for unified wrapping)\n *\n * When owner is a Signer:\n * - Creates hot ATA if it doesn't exist\n * - Loads cold (compressed) tokens into hot ATA\n * - Wraps SPL/T22 tokens into light-token associated token account\n * - Returns account with all tokens ready to use\n *\n * When owner is a PublicKey:\n * - Creates hot ATA if it doesn't exist\n * - Returns aggregated balance but does NOT auto-load (can't sign)\n *\n * @param rpc RPC connection\n * @param payer Fee payer\n * @param mint Mint address\n * @param owner Owner (Signer for auto-load, PublicKey for read-only)\n * @param allowOwnerOffCurve Allow PDA owners (default: false)\n * @param commitment Optional commitment level\n * @param confirmOptions Optional confirm options\n * @returns AccountInterface with unified balance and source breakdown\n */\nexport async function getOrCreateAtaInterface(\n rpc: Rpc,\n payer: Signer,\n mint: PublicKey,\n owner: PublicKey | Signer,\n allowOwnerOffCurve = false,\n commitment?: Commitment,\n confirmOptions?: ConfirmOptions,\n): Promise<AccountInterface> {\n return _getOrCreateAtaInterface(\n rpc,\n payer,\n mint,\n owner,\n allowOwnerOffCurve,\n commitment,\n confirmOptions,\n LIGHT_TOKEN_PROGRAM_ID,\n getAtaProgramId(LIGHT_TOKEN_PROGRAM_ID),\n true, // wrap=true for unified path\n );\n}\n\n/**\n * Create transfer instructions for a unified token transfer.\n *\n * Unified variant: always wraps SPL/T22 to light-token associated token account.\n *\n * Returns `TransactionInstruction[][]`. Send [0..n-2] in parallel, then [n-1].\n * Use `sliceLast` to separate the parallel prefix from the final transfer.\n *\n * @see createTransferInterfaceInstructions in v3/actions/transfer-interface.ts\n */\nexport async function createTransferInterfaceInstructions(\n rpc: Rpc,\n payer: PublicKey,\n mint: PublicKey,\n amount: number | bigint | BN,\n sender: PublicKey,\n destination: PublicKey,\n options?: Omit<_TransferOptions, 'wrap'>,\n): Promise<TransactionInstruction[][]> {\n const mintInterface = await getMintInterface(rpc, mint);\n return _createTransferInterfaceInstructions(\n rpc,\n payer,\n mint,\n amount,\n sender,\n destination,\n mintInterface.mint.decimals,\n {\n ...options,\n wrap: true,\n },\n );\n}\n\n/**\n * Build instruction batches for unwrapping light-tokens to SPL/T22.\n *\n * Load batches (cold -> hot) come first if needed; unwrap is bundled into the\n * final batch.\n * SPL/T22 balances are not consolidated; only light ATA (hot + cold) is unwrapped.\n *\n * Returns `TransactionInstruction[][]`. Load-only batches (if any) come first;\n * the last batch contains unwrap.\n *\n * @param rpc RPC connection\n * @param destination Destination SPL/T22 token account (must exist)\n * @param owner Owner of the light-token\n * @param mint Mint address\n * @param amount Amount to unwrap (defaults to full balance)\n * @param payer Fee payer (defaults to owner)\n * @param splInterfaceInfo Optional: SPL interface info\n * @param interfaceOptions Optional: interface options for load\n * @returns Instruction batches - each inner array is one transaction\n */\nexport async function createUnwrapInstructions(\n rpc: Rpc,\n destination: PublicKey,\n owner: PublicKey,\n mint: PublicKey,\n amount?: number | bigint | BN,\n payer?: PublicKey,\n splInterfaceInfo?: SplInterfaceInfo,\n interfaceOptions?: InterfaceOptions,\n): Promise<TransactionInstruction[][]> {\n const mintInterface = await getMintInterface(rpc, mint);\n return _createUnwrapInstructions(\n rpc,\n destination,\n owner,\n mint,\n mintInterface.mint.decimals,\n amount,\n payer,\n splInterfaceInfo,\n undefined, // maxTopUp - use default\n interfaceOptions,\n false, // always no wrap on unwrap.\n );\n}\n\n/**\n * Unwrap light-tokens to SPL tokens.\n *\n * Loads cold into hot if needed, then unwraps from light ATA to destination SPL/T22.\n * SPL/T22 balances are not consolidated; only light ATA balance is unwrapped.\n *\n * @param rpc RPC connection\n * @param payer Fee payer\n * @param destination Destination SPL/T22 token account\n * @param owner Owner of the light-token (signer)\n * @param mint Mint address\n * @param amount Amount to unwrap (defaults to all)\n * @param splInterfaceInfo SPL interface info\n * @param confirmOptions Confirm options\n * @returns Transaction signature of the unwrap transaction\n */\nexport async function unwrap(\n rpc: Rpc,\n payer: Signer,\n destination: PublicKey,\n owner: Signer,\n mint: PublicKey,\n amount?: number | bigint | BN,\n splInterfaceInfo?: SplInterfaceInfo,\n confirmOptions?: ConfirmOptions,\n decimals?: number,\n): Promise<string> {\n return _unwrap(\n rpc,\n payer,\n destination,\n owner,\n mint,\n amount,\n splInterfaceInfo,\n undefined, // maxTopUp - use default\n confirmOptions,\n decimals,\n false, // always no wrap on unwrap.\n );\n}\n\nexport type { _TransferOptions as TransferOptions };\n\nexport {\n getAccountInterface,\n AccountInterface,\n TokenAccountSource,\n // Note: Account is already exported from @solana/spl-token via get-account-interface\n AccountState,\n ParsedTokenAccount,\n parseLightTokenHot,\n parseLightTokenCold,\n toAccountInfo,\n convertTokenDataToAccount,\n} from '../get-account-interface';\n\nexport { InterfaceOptions, sliceLast } from '../actions/transfer-interface';\n\nexport * from '../../actions';\nexport * from '../../utils';\nexport * from '../../constants';\nexport * from '../../idl';\nexport * from '../../layout';\nexport * from '../../program';\nexport * from '../../types';\nexport * from '../derivation';\n\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 createLightTokenTransferInstruction,\n createLightTokenTransferCheckedInstruction,\n createLightTokenFreezeAccountInstruction,\n createLightTokenThawAccountInstruction,\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 // getOrCreateAtaInterface is defined locally with unified behavior\n wrap,\n // unwrap and createUnwrapInstructions are defined locally with unified behavior\n mintTo as mintToLightToken,\n mintToCompressed,\n mintToInterface,\n updateMintAuthority,\n updateFreezeAuthority,\n updateMetadataField,\n updateMetadataAuthority,\n removeMetadataKey,\n // Helpers\n getMintInterface,\n unpackMintInterface,\n unpackMintData,\n MintInterface,\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\n toOffChainMetadataJson,\n OffChainTokenMetadata,\n OffChainTokenMetadataJson,\n} from '..';\n","import {\n ConfirmOptions,\n PublicKey,\n Signer,\n TransactionInstruction,\n TransactionSignature,\n} from '@solana/web3.js';\nimport {\n Rpc,\n buildAndSignTx,\n sendAndConfirmTx,\n dedupeSigner,\n assertBetaEnabled,\n} from '@lightprotocol/stateless.js';\nimport { sliceLast } from './transfer-interface';\nimport BN from 'bn.js';\nimport { createUnwrapInstructions } from '../instructions/unwrap';\nimport { getMintInterface } from '../get-mint-interface';\nimport { type SplInterfaceInfo } from '../../utils/get-token-pool-infos';\n\nexport { createUnwrapInstructions } from '../instructions/unwrap';\n\nexport async function unwrap(\n rpc: Rpc,\n payer: Signer,\n destination: PublicKey,\n owner: Signer,\n mint: PublicKey,\n amount?: number | bigint | BN,\n splInterfaceInfo?: SplInterfaceInfo,\n maxTopUp?: number,\n confirmOptions?: ConfirmOptions,\n decimals?: number,\n wrap = false,\n): Promise<TransactionSignature> {\n assertBetaEnabled();\n\n const resolvedDecimals =\n decimals ?? (await getMintInterface(rpc, mint)).mint.decimals;\n const batches = await createUnwrapInstructions(\n rpc,\n destination,\n owner.publicKey,\n mint,\n resolvedDecimals,\n amount,\n payer.publicKey,\n splInterfaceInfo,\n maxTopUp,\n undefined,\n wrap,\n );\n\n const additionalSigners = dedupeSigner(payer, [owner]);\n const { rest: loads, last: unwrapIxs } = sliceLast(batches);\n\n await Promise.all(\n loads.map(async (ixs: TransactionInstruction[]) => {\n const { blockhash } = await rpc.getLatestBlockhash();\n const tx = buildAndSignTx(ixs, payer, blockhash, additionalSigners);\n return sendAndConfirmTx(rpc, tx, confirmOptions);\n }),\n );\n\n const { blockhash } = await rpc.getLatestBlockhash();\n const tx = buildAndSignTx(unwrapIxs, payer, blockhash, additionalSigners);\n return sendAndConfirmTx(rpc, tx, confirmOptions);\n}\n"],"names":["async","getAtaInterface","rpc","ata","owner","mint","commitment","programId","_getAtaInterface","getAssociatedTokenAddressInterface","allowOwnerOffCurve","LIGHT_TOKEN_PROGRAM_ID","associatedTokenProgramId","equals","Error","_getAssociatedTokenAddressInterface","createLoadAtaInstructions","payer","options","mintInterface","getMintInterface","_createLoadAtaInstructions","decimals","loadAta","confirmOptions","interfaceOptions","signature","_loadAta","getAccountInfo","ix","createAssociatedTokenAccountInterfaceIdempotentInstruction","publicKey","blockhash","getLatestBlockhash","tx","buildAndSignTx","ComputeBudgetProgram","setComputeUnitLimit","units","sendAndConfirmTx","transferInterface","source","destination","amount","_transferInterface","undefined","getOrCreateAtaInterface","_getOrCreateAtaInterface","getAtaProgramId","createTransferInterfaceInstructions","sender","_createTransferInterfaceInstructions","wrap","createUnwrapInstructions","splInterfaceInfo","_createUnwrapInstructions","unwrap","maxTopUp","assertBetaEnabled","resolvedDecimals","batches","additionalSigners","dedupeSigner","rest","loads","last","unwrapIxs","sliceLast","Promise","all","map","ixs","_unwrap"],"mappings":"ysKA0DOA,eAAeC,GAClBC,EACAC,EACAC,EACAC,EACAC,EACAC,GAEA,OAAOC,EAAiBN,EAAKC,EAAKC,EAAOC,EAAMC,EAAYC,EAAW,EAC1E,CAegB,SAAAE,GACZJ,EACAD,EACAM,EAAqB,EACrBH,EAAuBI,EACvBC,GAEA,IAAKL,EAAUM,OAAOF,GAClB,MAAM,IAAIG,MACN,0JAIR,OAAOC,EACHV,EACAD,EACAM,EACAH,EACAK,EAER,CAaOZ,eAAegB,GAClBd,EACAC,EACAC,EACAC,EACAY,EACAC,GAEA,MAAMC,QAAsBC,EAAiBlB,EAAKG,GAClD,OAAOgB,EACHnB,EACAC,EACAC,EACAC,EACAc,EAAcd,KAAKiB,SACnBL,EACAC,EACA,EAER,CAkBOlB,eAAeuB,GAClBrB,EACAC,EACAC,EACAC,EACAY,EACAO,EACAC,EACAH,GAEAL,IAAUb,EAEV,MAAMsB,QAAkBC,EACpBzB,EACAC,EACAC,EACAC,EACAY,EACAO,EACAC,EACA,EACAH,GAIJ,GAAkB,OAAdI,UAC0BxB,EAAI0B,eAAezB,GAC3B,CACd,MAAM0B,EACFC,EACIb,EAAMc,UACN5B,EACAC,EAAM2B,UACN1B,EACAM,IAEFqB,UAAEA,SAAoB9B,EAAI+B,qBAC1BC,EAAKC,EACP,CACIC,EAAqBC,oBAAoB,CAAEC,MAAO,MAClDT,GAEJZ,EACAe,EACAf,EAAMc,UAAUlB,OAAOT,EAAM2B,WAAa,GAAK,CAAC3B,IAEpD,OAAOmC,EAAiBrC,EAAKgC,EAAIV,EACpC,CAGL,OAAOE,CACX,CAkBO1B,eAAewC,GAClBtC,EACAe,EACAwB,EACApC,EACAqC,EACAtC,EACAuC,EACAnB,EACAN,EACAI,GAEA,OAAOsB,EACH1C,EACAe,EACAwB,EACApC,EACAqC,EACAtC,EACAuC,OACAE,EACArB,EACAN,EACA,EACAI,EAER,CA8BOtB,eAAe8C,GAClB5C,EACAe,EACAZ,EACAD,EACAM,EAAqB,EACrBJ,EACAkB,GAEA,OAAOuB,EACH7C,EACAe,EACAZ,EACAD,EACAM,EACAJ,EACAkB,EACAb,EACAqC,GAAgBrC,GAChB,EAER,CAYOX,eAAeiD,GAClB/C,EACAe,EACAZ,EACAsC,EACAO,EACAR,EACAxB,GAEA,MAAMC,QAAsBC,EAAiBlB,EAAKG,GAClD,OAAO8C,GACHjD,EACAe,EACAZ,EACAsC,EACAO,EACAR,EACAvB,EAAcd,KAAKiB,SACnB,IACOJ,EACHkC,KAAM,GAGlB,CAsBOpD,eAAeqD,GAClBnD,EACAwC,EACAtC,EACAC,EACAsC,EACA1B,EACAqC,EACA7B,GAEA,MAAMN,QAAsBC,EAAiBlB,EAAKG,GAClD,OAAOkD,EACHrD,EACAwC,EACAtC,EACAC,EACAc,EAAcd,KAAKiB,SACnBqB,EACA1B,EACAqC,OACAT,EACApB,EACA,EAER,CAkBOzB,eAAewD,GAClBtD,EACAe,EACAyB,EACAtC,EACAC,EACAsC,EACAW,EACA9B,EACAF,GAEA,OClYGtB,eACHE,EACAe,EACAyB,EACAtC,EACAC,EACAsC,EACAW,EACAG,EACAjC,EACAF,EACA8B,EAAO,GAEPM,IAEA,MAAMC,EACFrC,UAAmBF,EAAiBlB,EAAKG,IAAOA,KAAKiB,SACnDsC,QAAgBP,EAClBnD,EACAwC,EACAtC,EAAM2B,UACN1B,EACAsD,EACAhB,EACA1B,EAAMc,UACNuB,EACAG,OACAZ,EACAO,GAGES,EAAoBC,EAAa7C,EAAO,CAACb,KACvC2D,KAAMC,EAAOC,KAAMC,GAAcC,EAAUP,SAE7CQ,QAAQC,IACVL,EAAMM,KAAItE,MAAOuE,IACb,MAAMvC,UAAEA,SAAoB9B,EAAI+B,qBAC1BC,EAAKC,EAAeoC,EAAKtD,EAAOe,EAAW6B,GACjD,OAAOtB,EAAiBrC,EAAKgC,EAAIV,EAAe,KAIxD,MAAMQ,UAAEA,SAAoB9B,EAAI+B,qBAC1BC,EAAKC,EAAe+B,EAAWjD,EAAOe,EAAW6B,GACvD,OAAOtB,EAAiBrC,EAAKgC,EAAIV,EACrC,CDqVWgD,CACHtE,EACAe,EACAyB,EACAtC,EACAC,EACAsC,EACAW,OACAT,EACArB,EACAF,EACA,EAER"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../../src/v3/unified/index.ts","../../../../../../src/v3/actions/unwrap.ts"],"sourcesContent":["/**\n * Exports for @lightprotocol/compressed-token/unified\n *\n * Import from `/unified` to get a single unified associated token account for SPL/T22 and light-token\n * mints.\n */\nimport {\n PublicKey,\n Signer,\n ConfirmOptions,\n Commitment,\n ComputeBudgetProgram,\n TransactionInstruction,\n} from '@solana/web3.js';\nimport {\n Rpc,\n LIGHT_TOKEN_PROGRAM_ID,\n buildAndSignTx,\n sendAndConfirmTx,\n} from '@lightprotocol/stateless.js';\nimport BN from 'bn.js';\n\nimport {\n getAtaInterface as _getAtaInterface,\n AccountInterface,\n} from '../get-account-interface';\nimport { getAssociatedTokenAddressInterface as _getAssociatedTokenAddressInterface } from '../get-associated-token-address-interface';\nimport {\n createLoadAtaInstructions as _createLoadAtaInstructions,\n loadAta as _loadAta,\n} from '../actions/load-ata';\nimport { createAssociatedTokenAccountInterfaceIdempotentInstruction } from '../instructions/create-ata-interface';\nimport {\n transferInterface as _transferInterface,\n transferToAccountInterface as _transferToAccountInterface,\n createTransferInterfaceInstructions as _createTransferInterfaceInstructions,\n createTransferToAccountInterfaceInstructions as _createTransferToAccountInterfaceInstructions,\n} from '../actions/transfer-interface';\nimport type { TransferOptions as _TransferOptions } from '../actions/transfer-interface';\nimport {\n approveInterface as _approveInterface,\n revokeInterface as _revokeInterface,\n} from '../actions/approve-interface';\nimport {\n createApproveInterfaceInstructions as _createApproveInterfaceInstructions,\n createRevokeInterfaceInstructions as _createRevokeInterfaceInstructions,\n} from '../instructions/approve-interface';\n\nimport { _getOrCreateAtaInterface } from '../actions/get-or-create-ata-interface';\nimport {\n createUnwrapInstructions as _createUnwrapInstructions,\n unwrap as _unwrap,\n} from '../actions/unwrap';\nimport { SplInterfaceInfo } from '../../utils/get-token-pool-infos';\nimport { getAtaProgramId } from '../ata-utils';\nimport { InterfaceOptions } from '..';\nimport { getMintInterface } from '../get-mint-interface';\n\n/**\n * Get associated token account with unified balance\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 (omit for unified behavior)\n * @returns AccountInterface with aggregated balance from all sources\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<AccountInterface> {\n return _getAtaInterface(rpc, ata, owner, mint, commitment, programId, true);\n}\n\n/**\n * Derive the canonical token associated token account for SPL/T22/light-token in the unified path.\n *\n * Enforces LIGHT_TOKEN_PROGRAM_ID.\n *\n * @param mint Mint public key\n * @param owner Owner public key\n * @param allowOwnerOffCurve Allow owner to be a PDA. Default false.\n * @param programId Token program ID. Default light-token.\n * @param associatedTokenProgramId Associated token program ID. Default\n * auto-detected.\n * @returns Associated token address.\n */\nexport function getAssociatedTokenAddressInterface(\n mint: PublicKey,\n owner: PublicKey,\n allowOwnerOffCurve = false,\n programId: PublicKey = LIGHT_TOKEN_PROGRAM_ID,\n associatedTokenProgramId?: PublicKey,\n): PublicKey {\n if (!programId.equals(LIGHT_TOKEN_PROGRAM_ID)) {\n throw new Error(\n 'Please derive the unified ATA from the light-token program; balances across SPL, T22, and light-token are unified under the canonical light-token ATA.',\n );\n }\n\n return _getAssociatedTokenAddressInterface(\n mint,\n owner,\n allowOwnerOffCurve,\n programId,\n associatedTokenProgramId,\n );\n}\n\n/**\n * Create instruction batches for loading ALL token balances into a light-token associated token account.\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 interface 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 true,\n );\n}\n\n/**\n * Load all token balances into the light-token associated token account.\n *\n * Wraps SPL/Token-2022 balances and decompresses compressed light-tokens\n * into the on-chain light-token associated token account. If no balances exist and the associated token account doesn't\n * exist, creates an empty ATA (idempotent).\n *\n * @param rpc RPC connection\n * @param ata Associated token address (light-token)\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 ATA exists and 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) {\n payer ??= owner;\n\n const signature = await _loadAta(\n rpc,\n ata,\n owner,\n mint,\n payer,\n confirmOptions,\n interfaceOptions,\n true,\n decimals,\n );\n\n // If nothing to load, ensure ATA exists (idempotent).\n if (signature === null) {\n const accountInfo = await rpc.getAccountInfo(ata);\n if (!accountInfo) {\n const ix =\n createAssociatedTokenAccountInterfaceIdempotentInstruction(\n payer.publicKey,\n ata,\n owner.publicKey,\n mint,\n LIGHT_TOKEN_PROGRAM_ID,\n );\n const { blockhash } = await rpc.getLatestBlockhash();\n const tx = buildAndSignTx(\n [\n ComputeBudgetProgram.setComputeUnitLimit({ units: 30_000 }),\n ix,\n ],\n payer,\n blockhash,\n payer.publicKey.equals(owner.publicKey) ? [] : [owner],\n );\n return sendAndConfirmTx(rpc, tx, confirmOptions);\n }\n }\n\n return signature;\n}\n\n/**\n * Transfer tokens using the unified ata interface.\n *\n * Destination ATA is derived from `recipient` and created idempotently.\n * Automatically wraps SPL/T22 to light-token associated token account.\n *\n * @param rpc RPC connection\n * @param payer Fee payer (signer)\n * @param source Source light-token associated token account address\n * @param mint Mint address\n * @param recipient Destination owner wallet address\n * @param owner Source owner (signer)\n * @param amount Amount to transfer\n * @param confirmOptions Optional confirm options\n * @param options Optional interface options\n * @returns Transaction signature\n */\nexport async function transferInterface(\n rpc: Rpc,\n payer: Signer,\n source: PublicKey,\n mint: PublicKey,\n recipient: PublicKey,\n owner: Signer,\n amount: number | bigint | BN,\n confirmOptions?: ConfirmOptions,\n options?: InterfaceOptions,\n decimals?: number,\n) {\n return _transferInterface(\n rpc,\n payer,\n source,\n mint,\n recipient,\n owner,\n amount,\n undefined, // programId: use default LIGHT_TOKEN_PROGRAM_ID\n confirmOptions,\n options,\n true, // wrap=true for unified\n decimals,\n );\n}\n\n/**\n * Transfer tokens to an explicit destination token account.\n *\n * Use this for advanced routing to non-ATA destinations.\n */\nexport async function transferToAccountInterface(\n rpc: Rpc,\n payer: Signer,\n source: PublicKey,\n mint: PublicKey,\n destination: PublicKey,\n owner: Signer,\n amount: number | bigint | BN,\n confirmOptions?: ConfirmOptions,\n options?: InterfaceOptions,\n decimals?: number,\n) {\n return _transferToAccountInterface(\n rpc,\n payer,\n source,\n mint,\n destination,\n owner,\n amount,\n undefined, // programId: use default LIGHT_TOKEN_PROGRAM_ID\n confirmOptions,\n options,\n true, // wrap=true for unified\n decimals,\n );\n}\n\n/**\n * Get or create light-token ATA with unified balance detection and auto-loading.\n *\n * Enforces LIGHT_TOKEN_PROGRAM_ID. Aggregates balances from:\n * - light-token associated token account (hot balance)\n * - compressed light-token accounts (cold balance)\n * - SPL token accounts (for unified wrapping)\n * - Token-2022 accounts (for unified wrapping)\n *\n * When owner is a Signer:\n * - Creates hot ATA if it doesn't exist\n * - Loads cold (compressed) tokens into hot ATA\n * - Wraps SPL/T22 tokens into light-token associated token account\n * - Returns account with all tokens ready to use\n *\n * When owner is a PublicKey:\n * - Creates hot ATA if it doesn't exist\n * - Returns aggregated balance but does NOT auto-load (can't sign)\n *\n * @param rpc RPC connection\n * @param payer Fee payer\n * @param mint Mint address\n * @param owner Owner (Signer for auto-load, PublicKey for read-only)\n * @param allowOwnerOffCurve Allow PDA owners (default: false)\n * @param commitment Optional commitment level\n * @param confirmOptions Optional confirm options\n * @returns AccountInterface with unified balance and source breakdown\n */\nexport async function getOrCreateAtaInterface(\n rpc: Rpc,\n payer: Signer,\n mint: PublicKey,\n owner: PublicKey | Signer,\n allowOwnerOffCurve = false,\n commitment?: Commitment,\n confirmOptions?: ConfirmOptions,\n): Promise<AccountInterface> {\n return _getOrCreateAtaInterface(\n rpc,\n payer,\n mint,\n owner,\n allowOwnerOffCurve,\n commitment,\n confirmOptions,\n LIGHT_TOKEN_PROGRAM_ID,\n getAtaProgramId(LIGHT_TOKEN_PROGRAM_ID),\n true, // wrap=true for unified path\n );\n}\n\n/**\n * Create transfer instructions for a unified token transfer.\n *\n * Unified variant: always wraps SPL/T22 to light-token associated token account.\n * Recipient must be an on-curve wallet address. For PDA/off-curve owners,\n * use createTransferToAccountInterfaceInstructions with an explicit destination ATA.\n *\n * Returns `TransactionInstruction[][]`. Send [0..n-2] in parallel, then [n-1].\n * Use `sliceLast` to separate the parallel prefix from the final transfer.\n *\n * @see createTransferInterfaceInstructions in v3/actions/transfer-interface.ts\n */\nexport async function createTransferInterfaceInstructions(\n rpc: Rpc,\n payer: PublicKey,\n mint: PublicKey,\n amount: number | bigint | BN,\n sender: PublicKey,\n recipient: PublicKey,\n options?: Omit<_TransferOptions, 'wrap'>,\n): Promise<TransactionInstruction[][]> {\n const mintInterface = await getMintInterface(rpc, mint);\n return _createTransferInterfaceInstructions(\n rpc,\n payer,\n mint,\n amount,\n sender,\n recipient,\n mintInterface.mint.decimals,\n {\n ...options,\n wrap: true,\n },\n );\n}\n\n/**\n * Create transfer instructions that route to an explicit destination token\n * account.\n */\nexport async function createTransferToAccountInterfaceInstructions(\n rpc: Rpc,\n payer: PublicKey,\n mint: PublicKey,\n amount: number | bigint | BN,\n sender: PublicKey,\n destination: PublicKey,\n options?: Omit<_TransferOptions, 'wrap'>,\n): Promise<TransactionInstruction[][]> {\n const mintInterface = await getMintInterface(rpc, mint);\n return _createTransferToAccountInterfaceInstructions(\n rpc,\n payer,\n mint,\n amount,\n sender,\n destination,\n mintInterface.mint.decimals,\n {\n ...options,\n wrap: true,\n },\n );\n}\n\n/**\n * Build instruction batches for unwrapping light-tokens to SPL/T22.\n *\n * Load batches (cold -> hot) come first if needed; unwrap is bundled into the\n * final batch.\n * SPL/T22 balances are not consolidated; only light ATA (hot + cold) is unwrapped.\n *\n * Returns `TransactionInstruction[][]`. Load-only batches (if any) come first;\n * the last batch contains unwrap.\n *\n * @param rpc RPC connection\n * @param destination Destination SPL/T22 token account (must exist)\n * @param owner Owner of the light-token\n * @param mint Mint address\n * @param amount Amount to unwrap (defaults to full balance)\n * @param payer Fee payer (defaults to owner)\n * @param splInterfaceInfo Optional: SPL interface info\n * @param interfaceOptions Optional: interface options for load\n * @returns Instruction batches - each inner array is one transaction\n */\nexport async function createUnwrapInstructions(\n rpc: Rpc,\n destination: PublicKey,\n owner: PublicKey,\n mint: PublicKey,\n amount?: number | bigint | BN,\n payer?: PublicKey,\n splInterfaceInfo?: SplInterfaceInfo,\n interfaceOptions?: InterfaceOptions,\n): Promise<TransactionInstruction[][]> {\n const mintInterface = await getMintInterface(rpc, mint);\n return _createUnwrapInstructions(\n rpc,\n destination,\n owner,\n mint,\n mintInterface.mint.decimals,\n amount,\n payer,\n splInterfaceInfo,\n undefined, // maxTopUp - use default\n interfaceOptions,\n false, // always no wrap on unwrap.\n );\n}\n\n/**\n * Unwrap light-tokens to SPL tokens.\n *\n * Loads cold into hot if needed, then unwraps from light ATA to destination SPL/T22.\n * SPL/T22 balances are not consolidated; only light ATA balance is unwrapped.\n *\n * @param rpc RPC connection\n * @param payer Fee payer\n * @param destination Destination SPL/T22 token account\n * @param owner Owner of the light-token (signer)\n * @param mint Mint address\n * @param amount Amount to unwrap (defaults to all)\n * @param splInterfaceInfo SPL interface info\n * @param confirmOptions Confirm options\n * @returns Transaction signature of the unwrap transaction\n */\nexport async function unwrap(\n rpc: Rpc,\n payer: Signer,\n destination: PublicKey,\n owner: Signer,\n mint: PublicKey,\n amount?: number | bigint | BN,\n splInterfaceInfo?: SplInterfaceInfo,\n confirmOptions?: ConfirmOptions,\n decimals?: number,\n): Promise<string> {\n return _unwrap(\n rpc,\n payer,\n destination,\n owner,\n mint,\n amount,\n splInterfaceInfo,\n undefined, // maxTopUp - use default\n confirmOptions,\n decimals,\n false, // always no wrap on unwrap.\n );\n}\n\nexport type {\n _TransferOptions as TransferOptions,\n _TransferOptions as TransferToAccountOptions,\n};\n\n/**\n * Approve a delegate for an associated token account.\n *\n * Auto-detects mint type (light-token, SPL, or Token-2022) and dispatches\n * to the appropriate instruction.\n *\n * @remarks For light-token mints, all cold (compressed) balances are loaded\n * into the hot ATA, not just the delegation amount. The `amount` parameter\n * only controls the delegate's spending limit.\n *\n * @param rpc RPC connection\n * @param payer Fee payer (signer)\n * @param tokenAccount ATA address\n * @param mint Mint address\n * @param delegate Delegate to approve\n * @param amount Amount to delegate\n * @param owner Owner of the token account (signer)\n * @param confirmOptions Optional confirm options\n * @returns Transaction signature\n */\nexport async function approveInterface(\n rpc: Rpc,\n payer: Signer,\n tokenAccount: PublicKey,\n mint: PublicKey,\n delegate: PublicKey,\n amount: number | bigint | BN,\n owner: Signer,\n confirmOptions?: ConfirmOptions,\n options?: InterfaceOptions,\n decimals?: number,\n) {\n return _approveInterface(\n rpc,\n payer,\n tokenAccount,\n mint,\n delegate,\n amount,\n owner,\n confirmOptions,\n undefined, // programId: use default LIGHT_TOKEN_PROGRAM_ID\n true, // wrap=true for unified\n options,\n decimals,\n );\n}\n\n/**\n * Build instruction batches for approving a delegate on an ATA.\n *\n * Auto-detects mint type (light-token, SPL, or Token-2022).\n *\n * @remarks For light-token mints, all cold (compressed) balances are loaded\n * into the hot ATA before the approve instruction. The `amount` parameter\n * only controls the delegate's spending limit, not the number of accounts\n * loaded.\n */\nexport async function createApproveInterfaceInstructions(\n rpc: Rpc,\n payer: PublicKey,\n mint: PublicKey,\n tokenAccount: PublicKey,\n delegate: PublicKey,\n amount: number | bigint | BN,\n owner: PublicKey,\n decimals?: number,\n options?: InterfaceOptions,\n): Promise<TransactionInstruction[][]> {\n const resolvedDecimals =\n decimals ?? (await getMintInterface(rpc, mint)).mint.decimals;\n return _createApproveInterfaceInstructions(\n rpc,\n payer,\n mint,\n tokenAccount,\n delegate,\n amount,\n owner,\n resolvedDecimals,\n undefined, // programId: use default LIGHT_TOKEN_PROGRAM_ID\n true, // wrap=true for unified\n options,\n );\n}\n\n/**\n * Revoke delegation for an associated token account.\n *\n * Auto-detects mint type (light-token, SPL, or Token-2022) and dispatches\n * to the appropriate instruction.\n *\n * @remarks For light-token mints, all cold (compressed) balances are loaded\n * into the hot ATA before the revoke instruction.\n *\n * @param rpc RPC connection\n * @param payer Fee payer (signer)\n * @param tokenAccount ATA address\n * @param mint Mint address\n * @param owner Owner of the token account (signer)\n * @param confirmOptions Optional confirm options\n * @returns Transaction signature\n */\nexport async function revokeInterface(\n rpc: Rpc,\n payer: Signer,\n tokenAccount: PublicKey,\n mint: PublicKey,\n owner: Signer,\n confirmOptions?: ConfirmOptions,\n options?: InterfaceOptions,\n decimals?: number,\n) {\n return _revokeInterface(\n rpc,\n payer,\n tokenAccount,\n mint,\n owner,\n confirmOptions,\n undefined, // programId: use default LIGHT_TOKEN_PROGRAM_ID\n true, // wrap=true for unified\n options,\n decimals,\n );\n}\n\n/**\n * Build instruction batches for revoking delegation on an ATA.\n *\n * Auto-detects mint type (light-token, SPL, or Token-2022).\n *\n * @remarks For light-token mints, all cold (compressed) balances are loaded\n * into the hot ATA before the revoke instruction.\n */\nexport async function createRevokeInterfaceInstructions(\n rpc: Rpc,\n payer: PublicKey,\n mint: PublicKey,\n tokenAccount: PublicKey,\n owner: PublicKey,\n decimals?: number,\n options?: InterfaceOptions,\n): Promise<TransactionInstruction[][]> {\n const resolvedDecimals =\n decimals ?? (await getMintInterface(rpc, mint)).mint.decimals;\n return _createRevokeInterfaceInstructions(\n rpc,\n payer,\n mint,\n tokenAccount,\n owner,\n resolvedDecimals,\n undefined, // programId: use default LIGHT_TOKEN_PROGRAM_ID\n true, // wrap=true for unified\n options,\n );\n}\n\nexport {\n getAccountInterface,\n AccountInterface,\n TokenAccountSource,\n // Note: Account is already exported from @solana/spl-token via get-account-interface\n AccountState,\n ParsedTokenAccount,\n parseLightTokenHot,\n parseLightTokenCold,\n toAccountInfo,\n convertTokenDataToAccount,\n} from '../get-account-interface';\n\nexport { InterfaceOptions, sliceLast } from '../actions/transfer-interface';\n\nexport * from '../../actions';\nexport * from '../../utils';\nexport * from '../../constants';\nexport * from '../../idl';\nexport * from '../../layout';\nexport * from '../../program';\nexport * from '../../types';\nexport * from '../derivation';\n\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 createLightTokenTransferInstruction,\n createLightTokenTransferCheckedInstruction,\n createLightTokenFreezeAccountInstruction,\n createLightTokenThawAccountInstruction,\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 // getOrCreateAtaInterface is defined locally with unified behavior\n wrap,\n // unwrap and createUnwrapInstructions are defined locally with unified behavior\n mintTo as mintToLightToken,\n mintToCompressed,\n mintToInterface,\n updateMintAuthority,\n updateFreezeAuthority,\n updateMetadataField,\n updateMetadataAuthority,\n removeMetadataKey,\n // Helpers\n getMintInterface,\n unpackMintInterface,\n unpackMintData,\n MintInterface,\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\n toOffChainMetadataJson,\n OffChainTokenMetadata,\n OffChainTokenMetadataJson,\n} from '..';\n","import {\n ConfirmOptions,\n PublicKey,\n Signer,\n TransactionInstruction,\n TransactionSignature,\n} from '@solana/web3.js';\nimport {\n Rpc,\n buildAndSignTx,\n sendAndConfirmTx,\n dedupeSigner,\n assertBetaEnabled,\n} from '@lightprotocol/stateless.js';\nimport { sliceLast } from './transfer-interface';\nimport BN from 'bn.js';\nimport { createUnwrapInstructions } from '../instructions/unwrap';\nimport { getMintInterface } from '../get-mint-interface';\nimport { type SplInterfaceInfo } from '../../utils/get-token-pool-infos';\n\nexport { createUnwrapInstructions } from '../instructions/unwrap';\n\nexport async function unwrap(\n rpc: Rpc,\n payer: Signer,\n destination: PublicKey,\n owner: Signer,\n mint: PublicKey,\n amount?: number | bigint | BN,\n splInterfaceInfo?: SplInterfaceInfo,\n maxTopUp?: number,\n confirmOptions?: ConfirmOptions,\n decimals?: number,\n wrap = false,\n): Promise<TransactionSignature> {\n assertBetaEnabled();\n\n const resolvedDecimals =\n decimals ?? (await getMintInterface(rpc, mint)).mint.decimals;\n const batches = await createUnwrapInstructions(\n rpc,\n destination,\n owner.publicKey,\n mint,\n resolvedDecimals,\n amount,\n payer.publicKey,\n splInterfaceInfo,\n maxTopUp,\n undefined,\n wrap,\n );\n\n const additionalSigners = dedupeSigner(payer, [owner]);\n const { rest: loads, last: unwrapIxs } = sliceLast(batches);\n\n await Promise.all(\n loads.map(async (ixs: TransactionInstruction[]) => {\n const { blockhash } = await rpc.getLatestBlockhash();\n const tx = buildAndSignTx(ixs, payer, blockhash, additionalSigners);\n return sendAndConfirmTx(rpc, tx, confirmOptions);\n }),\n );\n\n const { blockhash } = await rpc.getLatestBlockhash();\n const tx = buildAndSignTx(unwrapIxs, payer, blockhash, additionalSigners);\n return sendAndConfirmTx(rpc, tx, confirmOptions);\n}\n"],"names":["async","getAtaInterface","rpc","ata","owner","mint","commitment","programId","_getAtaInterface","getAssociatedTokenAddressInterface","allowOwnerOffCurve","LIGHT_TOKEN_PROGRAM_ID","associatedTokenProgramId","equals","Error","_getAssociatedTokenAddressInterface","createLoadAtaInstructions","payer","options","mintInterface","getMintInterface","_createLoadAtaInstructions","decimals","loadAta","confirmOptions","interfaceOptions","signature","_loadAta","getAccountInfo","ix","createAssociatedTokenAccountInterfaceIdempotentInstruction","publicKey","blockhash","getLatestBlockhash","tx","buildAndSignTx","ComputeBudgetProgram","setComputeUnitLimit","units","sendAndConfirmTx","transferInterface","source","recipient","amount","_transferInterface","undefined","transferToAccountInterface","destination","_transferToAccountInterface","getOrCreateAtaInterface","_getOrCreateAtaInterface","getAtaProgramId","createTransferInterfaceInstructions","sender","_createTransferInterfaceInstructions","wrap","createTransferToAccountInterfaceInstructions","_createTransferToAccountInterfaceInstructions","createUnwrapInstructions","splInterfaceInfo","_createUnwrapInstructions","unwrap","maxTopUp","assertBetaEnabled","resolvedDecimals","batches","additionalSigners","dedupeSigner","rest","loads","last","unwrapIxs","sliceLast","Promise","all","map","ixs","_unwrap","approveInterface","tokenAccount","delegate","_approveInterface","createApproveInterfaceInstructions","_createApproveInterfaceInstructions","revokeInterface","_revokeInterface","createRevokeInterfaceInstructions","_createRevokeInterfaceInstructions"],"mappings":"+0KAqEOA,eAAeC,GAClBC,EACAC,EACAC,EACAC,EACAC,EACAC,GAEA,OAAOC,EAAiBN,EAAKC,EAAKC,EAAOC,EAAMC,EAAYC,EAAW,EAC1E,CAegB,SAAAE,GACZJ,EACAD,EACAM,EAAqB,EACrBH,EAAuBI,EACvBC,GAEA,IAAKL,EAAUM,OAAOF,GAClB,MAAM,IAAIG,MACN,0JAIR,OAAOC,EACHV,EACAD,EACAM,EACAH,EACAK,EAER,CAaOZ,eAAegB,GAClBd,EACAC,EACAC,EACAC,EACAY,EACAC,GAEA,MAAMC,QAAsBC,EAAiBlB,EAAKG,GAClD,OAAOgB,EACHnB,EACAC,EACAC,EACAC,EACAc,EAAcd,KAAKiB,SACnBL,EACAC,EACA,EAER,CAkBOlB,eAAeuB,GAClBrB,EACAC,EACAC,EACAC,EACAY,EACAO,EACAC,EACAH,GAEAL,IAAUb,EAEV,MAAMsB,QAAkBC,EACpBzB,EACAC,EACAC,EACAC,EACAY,EACAO,EACAC,EACA,EACAH,GAIJ,GAAkB,OAAdI,UAC0BxB,EAAI0B,eAAezB,GAC3B,CACd,MAAM0B,EACFC,EACIb,EAAMc,UACN5B,EACAC,EAAM2B,UACN1B,EACAM,IAEFqB,UAAEA,SAAoB9B,EAAI+B,qBAC1BC,EAAKC,EACP,CACIC,EAAqBC,oBAAoB,CAAEC,MAAO,MAClDT,GAEJZ,EACAe,EACAf,EAAMc,UAAUlB,OAAOT,EAAM2B,WAAa,GAAK,CAAC3B,IAEpD,OAAOmC,EAAiBrC,EAAKgC,EAAIV,EACpC,CAGL,OAAOE,CACX,CAmBO1B,eAAewC,GAClBtC,EACAe,EACAwB,EACApC,EACAqC,EACAtC,EACAuC,EACAnB,EACAN,EACAI,GAEA,OAAOsB,EACH1C,EACAe,EACAwB,EACApC,EACAqC,EACAtC,EACAuC,OACAE,EACArB,EACAN,EACA,EACAI,EAER,CAOOtB,eAAe8C,GAClB5C,EACAe,EACAwB,EACApC,EACA0C,EACA3C,EACAuC,EACAnB,EACAN,EACAI,GAEA,OAAO0B,EACH9C,EACAe,EACAwB,EACApC,EACA0C,EACA3C,EACAuC,OACAE,EACArB,EACAN,EACA,EACAI,EAER,CA8BOtB,eAAeiD,GAClB/C,EACAe,EACAZ,EACAD,EACAM,EAAqB,EACrBJ,EACAkB,GAEA,OAAO0B,EACHhD,EACAe,EACAZ,EACAD,EACAM,EACAJ,EACAkB,EACAb,EACAwC,EAAgBxC,GAChB,EAER,CAcOX,eAAeoD,GAClBlD,EACAe,EACAZ,EACAsC,EACAU,EACAX,EACAxB,GAEA,MAAMC,QAAsBC,EAAiBlB,EAAKG,GAClD,OAAOiD,EACHpD,EACAe,EACAZ,EACAsC,EACAU,EACAX,EACAvB,EAAcd,KAAKiB,SACnB,IACOJ,EACHqC,KAAM,GAGlB,CAMOvD,eAAewD,GAClBtD,EACAe,EACAZ,EACAsC,EACAU,EACAN,EACA7B,GAEA,MAAMC,QAAsBC,EAAiBlB,EAAKG,GAClD,OAAOoD,EACHvD,EACAe,EACAZ,EACAsC,EACAU,EACAN,EACA5B,EAAcd,KAAKiB,SACnB,IACOJ,EACHqC,KAAM,GAGlB,CAsBOvD,eAAe0D,GAClBxD,EACA6C,EACA3C,EACAC,EACAsC,EACA1B,EACA0C,EACAlC,GAEA,MAAMN,QAAsBC,EAAiBlB,EAAKG,GAClD,OAAOuD,EACH1D,EACA6C,EACA3C,EACAC,EACAc,EAAcd,KAAKiB,SACnBqB,EACA1B,EACA0C,OACAd,EACApB,EACA,EAER,CAkBOzB,eAAe6D,GAClB3D,EACAe,EACA8B,EACA3C,EACAC,EACAsC,EACAgB,EACAnC,EACAF,GAEA,OC9cGtB,eACHE,EACAe,EACA8B,EACA3C,EACAC,EACAsC,EACAgB,EACAG,EACAtC,EACAF,EACAiC,EAAO,GAEPQ,IAEA,MAAMC,EACF1C,UAAmBF,EAAiBlB,EAAKG,IAAOA,KAAKiB,SACnD2C,QAAgBP,EAClBxD,EACA6C,EACA3C,EAAM2B,UACN1B,EACA2D,EACArB,EACA1B,EAAMc,UACN4B,EACAG,OACAjB,EACAU,GAGEW,EAAoBC,EAAalD,EAAO,CAACb,KACvCgE,KAAMC,EAAOC,KAAMC,GAAcC,EAAUP,SAE7CQ,QAAQC,IACVL,EAAMM,KAAI3E,MAAO4E,IACb,MAAM5C,UAAEA,SAAoB9B,EAAI+B,qBAC1BC,EAAKC,EAAeyC,EAAK3D,EAAOe,EAAWkC,GACjD,OAAO3B,EAAiBrC,EAAKgC,EAAIV,EAAe,KAIxD,MAAMQ,UAAEA,SAAoB9B,EAAI+B,qBAC1BC,EAAKC,EAAeoC,EAAWtD,EAAOe,EAAWkC,GACvD,OAAO3B,EAAiBrC,EAAKgC,EAAIV,EACrC,CDiaWqD,CACH3E,EACAe,EACA8B,EACA3C,EACAC,EACAsC,EACAgB,OACAd,EACArB,EACAF,EACA,EAER,CA2BOtB,eAAe8E,GAClB5E,EACAe,EACA8D,EACA1E,EACA2E,EACArC,EACAvC,EACAoB,EACAN,EACAI,GAEA,OAAO2D,EACH/E,EACAe,EACA8D,EACA1E,EACA2E,EACArC,EACAvC,EACAoB,OACAqB,EACA,EACA3B,EACAI,EAER,CAYOtB,eAAekF,GAClBhF,EACAe,EACAZ,EACA0E,EACAC,EACArC,EACAvC,EACAkB,EACAJ,GAEA,MAAM8C,EACF1C,UAAmBF,EAAiBlB,EAAKG,IAAOA,KAAKiB,SACzD,OAAO6D,EACHjF,EACAe,EACAZ,EACA0E,EACAC,EACArC,EACAvC,EACA4D,OACAnB,EACA,EACA3B,EAER,CAmBOlB,eAAeoF,GAClBlF,EACAe,EACA8D,EACA1E,EACAD,EACAoB,EACAN,EACAI,GAEA,OAAO+D,GACHnF,EACAe,EACA8D,EACA1E,EACAD,EACAoB,OACAqB,EACA,EACA3B,EACAI,EAER,CAUOtB,eAAesF,GAClBpF,EACAe,EACAZ,EACA0E,EACA3E,EACAkB,EACAJ,GAEA,MAAM8C,EACF1C,UAAmBF,EAAiBlB,EAAKG,IAAOA,KAAKiB,SACzD,OAAOiE,GACHrF,EACAe,EACAZ,EACA0E,EACA3E,EACA4D,OACAnB,EACA,EACA3B,EAER"}
@@ -1650,7 +1650,7 @@ declare function createLightTokenTransferInstruction(source: PublicKey, destinat
1650
1650
  * TransferChecked.
1651
1651
  */
1652
1652
  declare function createLightTokenTransferCheckedInstruction(source: PublicKey, destination: PublicKey, mint: PublicKey, owner: PublicKey, amount: number | bigint, decimals: number, payer: PublicKey): TransactionInstruction;
1653
- declare function createTransferInterfaceInstructions(rpc: Rpc, payer: PublicKey, mint: PublicKey, amount: number | bigint | BN, sender: PublicKey, destination: PublicKey, decimals: number, options?: TransferOptions): Promise<TransactionInstruction[][]>;
1653
+ declare function createTransferToAccountInterfaceInstructions(rpc: Rpc, payer: PublicKey, mint: PublicKey, amount: number | bigint | BN, sender: PublicKey, destination: PublicKey, decimals: number, options?: TransferOptions): Promise<TransactionInstruction[][]>;
1654
1654
 
1655
1655
  interface InterfaceOptions {
1656
1656
  splInterfaceInfos?: SplInterfaceInfo[];
@@ -1660,11 +1660,13 @@ interface InterfaceOptions {
1660
1660
  */
1661
1661
  owner?: PublicKey;
1662
1662
  }
1663
- declare function transferInterface(rpc: Rpc, payer: Signer, source: PublicKey, mint: PublicKey, destination: PublicKey, owner: Signer, amount: number | bigint | BN, programId?: PublicKey, confirmOptions?: ConfirmOptions, options?: InterfaceOptions, wrap?: boolean, decimals?: number): Promise<TransactionSignature>;
1663
+ declare function transferToAccountInterface(rpc: Rpc, payer: Signer, source: PublicKey, mint: PublicKey, destination: PublicKey, owner: Signer, amount: number | bigint | BN, programId?: PublicKey, confirmOptions?: ConfirmOptions, options?: InterfaceOptions, wrap?: boolean, decimals?: number): Promise<TransactionSignature>;
1664
+ declare function transferInterface(rpc: Rpc, payer: Signer, source: PublicKey, mint: PublicKey, recipient: PublicKey, owner: Signer, amount: number | bigint | BN, programId?: PublicKey, confirmOptions?: ConfirmOptions, options?: InterfaceOptions, wrap?: boolean, decimals?: number): Promise<TransactionSignature>;
1664
1665
  interface TransferOptions extends InterfaceOptions {
1665
1666
  wrap?: boolean;
1666
1667
  programId?: PublicKey;
1667
1668
  }
1669
+ declare function createTransferInterfaceInstructions(rpc: Rpc, payer: PublicKey, mint: PublicKey, amount: number | bigint | BN, sender: PublicKey, recipient: PublicKey, decimals: number, options?: TransferOptions): Promise<TransactionInstruction[][]>;
1668
1670
 
1669
1671
  declare function selectInputsForAmount(accounts: ParsedTokenAccount[], neededAmount: bigint): ParsedTokenAccount[];
1670
1672
 
@@ -1881,6 +1883,86 @@ declare function createLightTokenFreezeAccountInstruction(tokenAccount: PublicKe
1881
1883
  */
1882
1884
  declare function createLightTokenThawAccountInstruction(tokenAccount: PublicKey, mint: PublicKey, freezeAuthority: PublicKey): TransactionInstruction;
1883
1885
 
1886
+ /**
1887
+ * Create an instruction to approve a delegate for a light-token account.
1888
+ *
1889
+ * Account order per program:
1890
+ * 0. token_account (mutable) - the light-token account
1891
+ * 1. delegate (readonly) - the delegate to approve
1892
+ * 2. owner (signer) - owner of the token account
1893
+ * 3. system_program (readonly) - for rent top-ups via CPI
1894
+ * 4. fee_payer (mutable, signer) - pays for rent top-ups
1895
+ *
1896
+ * @param tokenAccount The light-token account to set delegation on
1897
+ * @param delegate The delegate to approve
1898
+ * @param owner Owner of the token account (signer)
1899
+ * @param amount Amount of tokens to delegate
1900
+ * @param feePayer Optional fee payer for rent top-ups (defaults to owner)
1901
+ * @returns TransactionInstruction
1902
+ */
1903
+ declare function createLightTokenApproveInstruction(tokenAccount: PublicKey, delegate: PublicKey, owner: PublicKey, amount: number | bigint, feePayer?: PublicKey): TransactionInstruction;
1904
+ /**
1905
+ * Create an instruction to revoke delegation for a light-token account.
1906
+ *
1907
+ * Account order per program:
1908
+ * 0. token_account (mutable) - the light-token account
1909
+ * 1. owner (signer) - owner of the token account
1910
+ * 2. system_program (readonly) - for rent top-ups via CPI
1911
+ * 3. fee_payer (mutable, signer) - pays for rent top-ups
1912
+ *
1913
+ * @param tokenAccount The light-token account to revoke delegation on
1914
+ * @param owner Owner of the token account (signer)
1915
+ * @param feePayer Optional fee payer for rent top-ups (defaults to owner)
1916
+ * @returns TransactionInstruction
1917
+ */
1918
+ declare function createLightTokenRevokeInstruction(tokenAccount: PublicKey, owner: PublicKey, feePayer?: PublicKey): TransactionInstruction;
1919
+
1920
+ /**
1921
+ * Build instruction batches for approving a delegate on an ATA.
1922
+ *
1923
+ * Supports light-token, SPL, and Token-2022 mints.
1924
+ * Returns `TransactionInstruction[][]`. Send [0..n-2] in parallel, then [n-1].
1925
+ *
1926
+ * @remarks For light-token mints, all cold (compressed) balances are loaded
1927
+ * into the hot ATA before the approve instruction. The `amount` parameter
1928
+ * only controls the delegate's spending limit, not the number of accounts
1929
+ * loaded. Users with many cold accounts may see additional load transactions.
1930
+ *
1931
+ * @param rpc RPC connection
1932
+ * @param payer Fee payer public key
1933
+ * @param mint Mint address
1934
+ * @param tokenAccount ATA address
1935
+ * @param delegate Delegate to approve
1936
+ * @param amount Amount to delegate
1937
+ * @param owner Owner public key
1938
+ * @param decimals Token decimals
1939
+ * @param programId Token program ID (default: LIGHT_TOKEN_PROGRAM_ID)
1940
+ * @param wrap When true and mint is SPL/T22, wrap into light-token then approve
1941
+ * @returns Instruction batches
1942
+ */
1943
+ declare function createApproveInterfaceInstructions(rpc: Rpc, payer: PublicKey, mint: PublicKey, tokenAccount: PublicKey, delegate: PublicKey, amount: number | bigint | BN, owner: PublicKey, decimals: number, programId?: PublicKey, wrap?: boolean, options?: InterfaceOptions): Promise<TransactionInstruction[][]>;
1944
+ /**
1945
+ * Build instruction batches for revoking delegation on an ATA.
1946
+ *
1947
+ * Supports light-token, SPL, and Token-2022 mints.
1948
+ * Returns `TransactionInstruction[][]`. Send [0..n-2] in parallel, then [n-1].
1949
+ *
1950
+ * @remarks For light-token mints, all cold (compressed) balances are loaded
1951
+ * into the hot ATA before the revoke instruction. Users with many cold
1952
+ * accounts may see additional load transactions.
1953
+ *
1954
+ * @param rpc RPC connection
1955
+ * @param payer Fee payer public key
1956
+ * @param mint Mint address
1957
+ * @param tokenAccount ATA address
1958
+ * @param owner Owner public key
1959
+ * @param decimals Token decimals
1960
+ * @param programId Token program ID (default: LIGHT_TOKEN_PROGRAM_ID)
1961
+ * @param wrap When true and mint is SPL/T22, wrap into light-token then revoke
1962
+ * @returns Instruction batches
1963
+ */
1964
+ declare function createRevokeInterfaceInstructions(rpc: Rpc, payer: PublicKey, mint: PublicKey, tokenAccount: PublicKey, owner: PublicKey, decimals: number, programId?: PublicKey, wrap?: boolean, options?: InterfaceOptions): Promise<TransactionInstruction[][]>;
1965
+
1884
1966
  /**
1885
1967
  * Create and initialize a new mint for SPL/T22/light-token.
1886
1968
  *
@@ -2130,6 +2212,50 @@ declare function getOrCreateAtaInterface(rpc: Rpc, payer: Signer, mint: PublicKe
2130
2212
  */
2131
2213
  declare function wrap(rpc: Rpc, payer: Signer, source: PublicKey, destination: PublicKey, owner: Signer, mint: PublicKey, amount: bigint, splInterfaceInfo?: SplInterfaceInfo, maxTopUp?: number, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
2132
2214
 
2215
+ /**
2216
+ * Approve a delegate for an associated token account.
2217
+ *
2218
+ * Supports light-token, SPL, and Token-2022 mints. For light-token mints,
2219
+ * loads cold accounts if needed before sending the approve instruction.
2220
+ *
2221
+ * @remarks For light-token mints, all cold (compressed) balances are loaded
2222
+ * into the hot ATA, not just the delegation amount. The `amount` parameter
2223
+ * only controls the delegate's spending limit.
2224
+ *
2225
+ * @param rpc RPC connection
2226
+ * @param payer Fee payer (signer)
2227
+ * @param tokenAccount ATA address
2228
+ * @param mint Mint address
2229
+ * @param delegate Delegate to approve
2230
+ * @param amount Amount to delegate
2231
+ * @param owner Owner of the token account (signer)
2232
+ * @param confirmOptions Optional confirm options
2233
+ * @param programId Token program ID (default: LIGHT_TOKEN_PROGRAM_ID)
2234
+ * @param wrap When true and mint is SPL/T22, wrap into light-token then approve
2235
+ * @returns Transaction signature
2236
+ */
2237
+ declare function approveInterface(rpc: Rpc, payer: Signer, tokenAccount: PublicKey, mint: PublicKey, delegate: PublicKey, amount: number | bigint | BN, owner: Signer, confirmOptions?: ConfirmOptions, programId?: PublicKey, wrap?: boolean, options?: InterfaceOptions, decimals?: number): Promise<TransactionSignature>;
2238
+ /**
2239
+ * Revoke delegation for an associated token account.
2240
+ *
2241
+ * Supports light-token, SPL, and Token-2022 mints. For light-token mints,
2242
+ * loads cold accounts if needed before sending the revoke instruction.
2243
+ *
2244
+ * @remarks For light-token mints, all cold (compressed) balances are loaded
2245
+ * into the hot ATA before the revoke instruction.
2246
+ *
2247
+ * @param rpc RPC connection
2248
+ * @param payer Fee payer (signer)
2249
+ * @param tokenAccount ATA address
2250
+ * @param mint Mint address
2251
+ * @param owner Owner of the token account (signer)
2252
+ * @param confirmOptions Optional confirm options
2253
+ * @param programId Token program ID (default: LIGHT_TOKEN_PROGRAM_ID)
2254
+ * @param wrap When true and mint is SPL/T22, wrap into light-token then revoke
2255
+ * @returns Transaction signature
2256
+ */
2257
+ declare function revokeInterface(rpc: Rpc, payer: Signer, tokenAccount: PublicKey, mint: PublicKey, owner: Signer, confirmOptions?: ConfirmOptions, programId?: PublicKey, wrap?: boolean, options?: InterfaceOptions, decimals?: number): Promise<TransactionSignature>;
2258
+
2133
2259
  /**
2134
2260
  * Derive the canonical associated token address for any of SPL/T22/light-token.
2135
2261
  * Defaults to using light-token as the canonical associated token account.
@@ -5489,4 +5615,4 @@ declare function createLoadAtaInstructions(rpc: Rpc, ata: PublicKey, owner: Publ
5489
5615
  */
5490
5616
  declare function loadAta(rpc: Rpc, ata: PublicKey, owner: Signer, mint: PublicKey, payer?: Signer, confirmOptions?: ConfirmOptions, interfaceOptions?: InterfaceOptions, decimals?: number): Promise<TransactionSignature | null>;
5491
5617
 
5492
- export { ADD_TOKEN_POOL_DISCRIMINATOR, APPROVE_DISCRIMINATOR, type AccountInterface, Action, type AddSplInterfaceParams, type AddTokenPoolParams, type ApproveAndMintToParams, type ApproveParams, BASE_RENT_PER_EPOCH, BATCH_COMPRESS_DISCRIMINATOR, type BaseMint, type BatchCompressInstructionData, COMPRESSIBLE_LIGHT_TOKEN_ACCOUNT_SIZE, COMPRESSIBLE_LIGHT_TOKEN_RENT_PER_EPOCH, COMPRESSION_COST, COMPRESSION_INCENTIVE, COMPRESS_SPL_TOKEN_ACCOUNT_DISCRIMINATOR, CPI_AUTHORITY_SEED, CREATE_TOKEN_POOL_DISCRIMINATOR, type CompressParams, type CompressSplTokenAccountInstructionData, type CompressSplTokenAccountParams, type CompressedMint, type CompressedTokenInstructionDataApprove, CompressedTokenInstructionDataApproveLayout, type CompressedTokenInstructionDataRevoke, CompressedTokenInstructionDataRevokeLayout, type CompressedTokenInstructionDataTransfer, CompressedTokenInstructionDataTransferLayout, CompressedTokenProgram, type CompressibleConfig, CpiContextLayout, type CreateAssociatedLightTokenAccountParams, type CreateMintParams, type CreateSplInterfaceParams, type CreateTokenPoolParams, type CreateTokenProgramLookupTableParams, DEFAULT_COMPRESSIBLE_CONFIG, DEFAULT_PREPAY_EPOCHS, DEFAULT_WRITE_TOP_UP, type DecompressParams, type DelegatedTransfer, DelegatedTransferLayout, ERROR_MIXED_TREE_TYPES, ERROR_NO_ACCOUNTS_FOUND, ExtensionType, IDL, type InputTokenDataWithContext, type InterfaceOptions, LIGHT_TOKEN_CONFIG, LIGHT_TOKEN_RENT_SPONSOR, type LightCompressedToken, type LightTokenConfig, CompressedTokenProgram as LightTokenProgram, MAX_COMBINED_BATCH_BYTES, MAX_LOAD_ONLY_BATCH_BYTES, MAX_TOP_UP, MAX_TRANSACTION_SIZE, MINT_TO_DISCRIMINATOR, type MergeTokenAccountsParams, type MintContext, type MintExtension, type MintInterface, type MintToInstructionData, type MintToParams, type OffChainTokenMetadata, type OffChainTokenMetadataJson, POOL_SEED, type PackCompressedTokenAccountsParams, type PackedTokenTransferOutputData, RENT_PER_BYTE_PER_EPOCH, REVOKE_DISCRIMINATOR, type RevokeParams, SLOTS_PER_RENT_EPOCH, SPL_TOKEN_MINT_RENT_EXEMPT_BALANCE, type SelectInputAccountsOptions, type SelectedAccountsResult, type SplInterfaceActivity, type SplInterfaceInfo, TOTAL_COMPRESSION_COST, TRANSFER_DISCRIMINATOR, type TokenAccountSource, type TokenData, TokenDataVersion, type TokenMetadata, type TokenMetadataInstructionData, type TokenPoolActivity, type TokenPoolInfo, type TokenTransferOutputData, type TransferParams, addSplInterfaces, addTokenPoolAccountsLayout, type addTokenPoolAccountsLayoutParams, addTokenPools, approve, approveAccountsLayout, type approveAccountsLayoutParams, approveAndMintTo, batchCompressLayout, calculateFeePayerCostAtCreation, checkMint, checkSplInterfaceInfo, checkTokenPoolInfo, compress, compressSplTokenAccount, compressSplTokenAccountInstructionDataLayout, convertTokenDataToAccount, createAssociatedLightTokenAccountIdempotentInstruction, createAssociatedLightTokenAccountInstruction, createAssociatedTokenAccountInterfaceIdempotentInstruction, createAssociatedTokenAccountInterfaceInstruction, createAtaInterface, createAtaInterfaceIdempotent, createAtaInterfaceIdempotentInstruction, createDecompressOutputState, createLightTokenFreezeAccountInstruction, createLightTokenThawAccountInstruction, createLightTokenTransferCheckedInstruction, createLightTokenTransferInstruction, createLoadAtaInstructions, createMint, createMintInstruction, createMintInterface, createMintToCompressedInstruction, createMintToInstruction, createMintToInterfaceInstruction, createRemoveMetadataKeyInstruction, createSplInterface, createTokenMetadata, createTokenPool, createTokenPoolAccountsLayout, type createTokenPoolAccountsLayoutParams, createTokenProgramLookupTable, createTransferInterfaceInstructions, createTransferOutputState, createUnwrapInstruction, createUnwrapInstructions, createUpdateFreezeAuthorityInstruction, createUpdateMetadataAuthorityInstruction, createUpdateMetadataFieldInstruction, createUpdateMintAuthorityInstruction, createWrapInstruction, decodeApproveInstructionData, decodeBatchCompressInstructionData, decodeCompressSplTokenAccountInstructionData, decodeMintToInstructionData, decodeRevokeInstructionData, decodeTokenMetadata, decodeTransferInstructionData, decompress, decompressDelegated, deriveSplInterfaceInfo, deriveTokenPoolInfo, deserializeMint, encodeApproveInstructionData, encodeBatchCompressInstructionData, encodeCompressSplTokenAccountInstructionData, encodeMintToInstructionData, encodeRevokeInstructionData, encodeTokenMetadata, encodeTransferInstructionData, estimateTransactionSize, extractTokenMetadata, freezeAccountsLayout, type freezeAccountsLayoutParams, getAccountInterface, getAssociatedTokenAddressInterface, getAtaInterface, getMintInterface, getOrCreateAtaInterface, getSplInterfaceInfos, getTokenPoolInfos, groupAccountsByTreeType, isSingleSplInterfaceInfo, isSingleTokenPoolInfo, loadAta, mergeTokenAccounts, mintTo, mintToAccountsLayout, type mintToAccountsLayoutParams, mintToCompressed, mintToInterface, mintToLayout, mintTo$1 as mintToLightToken, packCompressedTokenAccounts, parseLightTokenCold, parseLightTokenHot, parseMaybeDelegatedTransfer, parseTokenData, removeMetadataKey, rentPerEpoch, revoke, revokeAccountsLayout, type revokeAccountsLayoutParams, selectAccountsByPreferredTreeType, selectInputsForAmount, selectMinCompressedTokenAccountsForDecompression, selectMinCompressedTokenAccountsForTransfer, selectMinCompressedTokenAccountsForTransferOrPartial, selectSmartCompressedTokenAccountsForTransfer, selectSmartCompressedTokenAccountsForTransferOrPartial, selectSplInterfaceInfo, selectSplInterfaceInfosForDecompression, selectTokenAccountsForApprove, selectTokenPoolInfo, selectTokenPoolInfosForDecompression, serializeMint, sliceLast, sumUpTokenAmount, thawAccountsLayout, type thawAccountsLayoutParams, toAccountInfo, toOffChainMetadataJson, toTokenPoolInfo, transfer, transferAccountsLayout, type transferAccountsLayoutParams, transferDelegated, transferInterface, unpackMintData, unpackMintInterface, updateFreezeAuthority, updateMetadataAuthority, updateMetadataField, updateMintAuthority, validateSameTokenOwner, wrap };
5618
+ export { ADD_TOKEN_POOL_DISCRIMINATOR, APPROVE_DISCRIMINATOR, type AccountInterface, Action, type AddSplInterfaceParams, type AddTokenPoolParams, type ApproveAndMintToParams, type ApproveParams, BASE_RENT_PER_EPOCH, BATCH_COMPRESS_DISCRIMINATOR, type BaseMint, type BatchCompressInstructionData, COMPRESSIBLE_LIGHT_TOKEN_ACCOUNT_SIZE, COMPRESSIBLE_LIGHT_TOKEN_RENT_PER_EPOCH, COMPRESSION_COST, COMPRESSION_INCENTIVE, COMPRESS_SPL_TOKEN_ACCOUNT_DISCRIMINATOR, CPI_AUTHORITY_SEED, CREATE_TOKEN_POOL_DISCRIMINATOR, type CompressParams, type CompressSplTokenAccountInstructionData, type CompressSplTokenAccountParams, type CompressedMint, type CompressedTokenInstructionDataApprove, CompressedTokenInstructionDataApproveLayout, type CompressedTokenInstructionDataRevoke, CompressedTokenInstructionDataRevokeLayout, type CompressedTokenInstructionDataTransfer, CompressedTokenInstructionDataTransferLayout, CompressedTokenProgram, type CompressibleConfig, CpiContextLayout, type CreateAssociatedLightTokenAccountParams, type CreateMintParams, type CreateSplInterfaceParams, type CreateTokenPoolParams, type CreateTokenProgramLookupTableParams, DEFAULT_COMPRESSIBLE_CONFIG, DEFAULT_PREPAY_EPOCHS, DEFAULT_WRITE_TOP_UP, type DecompressParams, type DelegatedTransfer, DelegatedTransferLayout, ERROR_MIXED_TREE_TYPES, ERROR_NO_ACCOUNTS_FOUND, ExtensionType, IDL, type InputTokenDataWithContext, type InterfaceOptions, LIGHT_TOKEN_CONFIG, LIGHT_TOKEN_RENT_SPONSOR, type LightCompressedToken, type LightTokenConfig, CompressedTokenProgram as LightTokenProgram, MAX_COMBINED_BATCH_BYTES, MAX_LOAD_ONLY_BATCH_BYTES, MAX_TOP_UP, MAX_TRANSACTION_SIZE, MINT_TO_DISCRIMINATOR, type MergeTokenAccountsParams, type MintContext, type MintExtension, type MintInterface, type MintToInstructionData, type MintToParams, type OffChainTokenMetadata, type OffChainTokenMetadataJson, POOL_SEED, type PackCompressedTokenAccountsParams, type PackedTokenTransferOutputData, RENT_PER_BYTE_PER_EPOCH, REVOKE_DISCRIMINATOR, type RevokeParams, SLOTS_PER_RENT_EPOCH, SPL_TOKEN_MINT_RENT_EXEMPT_BALANCE, type SelectInputAccountsOptions, type SelectedAccountsResult, type SplInterfaceActivity, type SplInterfaceInfo, TOTAL_COMPRESSION_COST, TRANSFER_DISCRIMINATOR, type TokenAccountSource, type TokenData, TokenDataVersion, type TokenMetadata, type TokenMetadataInstructionData, type TokenPoolActivity, type TokenPoolInfo, type TokenTransferOutputData, type TransferParams, addSplInterfaces, addTokenPoolAccountsLayout, type addTokenPoolAccountsLayoutParams, addTokenPools, approve, approveAccountsLayout, type approveAccountsLayoutParams, approveAndMintTo, approveInterface, batchCompressLayout, calculateFeePayerCostAtCreation, checkMint, checkSplInterfaceInfo, checkTokenPoolInfo, compress, compressSplTokenAccount, compressSplTokenAccountInstructionDataLayout, convertTokenDataToAccount, createApproveInterfaceInstructions, createAssociatedLightTokenAccountIdempotentInstruction, createAssociatedLightTokenAccountInstruction, createAssociatedTokenAccountInterfaceIdempotentInstruction, createAssociatedTokenAccountInterfaceInstruction, createAtaInterface, createAtaInterfaceIdempotent, createAtaInterfaceIdempotentInstruction, createDecompressOutputState, createLightTokenApproveInstruction, createLightTokenFreezeAccountInstruction, createLightTokenRevokeInstruction, createLightTokenThawAccountInstruction, createLightTokenTransferCheckedInstruction, createLightTokenTransferInstruction, createLoadAtaInstructions, createMint, createMintInstruction, createMintInterface, createMintToCompressedInstruction, createMintToInstruction, createMintToInterfaceInstruction, createRemoveMetadataKeyInstruction, createRevokeInterfaceInstructions, createSplInterface, createTokenMetadata, createTokenPool, createTokenPoolAccountsLayout, type createTokenPoolAccountsLayoutParams, createTokenProgramLookupTable, createTransferInterfaceInstructions, createTransferOutputState, createTransferToAccountInterfaceInstructions, createUnwrapInstruction, createUnwrapInstructions, createUpdateFreezeAuthorityInstruction, createUpdateMetadataAuthorityInstruction, createUpdateMetadataFieldInstruction, createUpdateMintAuthorityInstruction, createWrapInstruction, decodeApproveInstructionData, decodeBatchCompressInstructionData, decodeCompressSplTokenAccountInstructionData, decodeMintToInstructionData, decodeRevokeInstructionData, decodeTokenMetadata, decodeTransferInstructionData, decompress, decompressDelegated, deriveSplInterfaceInfo, deriveTokenPoolInfo, deserializeMint, encodeApproveInstructionData, encodeBatchCompressInstructionData, encodeCompressSplTokenAccountInstructionData, encodeMintToInstructionData, encodeRevokeInstructionData, encodeTokenMetadata, encodeTransferInstructionData, estimateTransactionSize, extractTokenMetadata, freezeAccountsLayout, type freezeAccountsLayoutParams, getAccountInterface, getAssociatedTokenAddressInterface, getAtaInterface, getMintInterface, getOrCreateAtaInterface, getSplInterfaceInfos, getTokenPoolInfos, groupAccountsByTreeType, isSingleSplInterfaceInfo, isSingleTokenPoolInfo, loadAta, mergeTokenAccounts, mintTo, mintToAccountsLayout, type mintToAccountsLayoutParams, mintToCompressed, mintToInterface, mintToLayout, mintTo$1 as mintToLightToken, packCompressedTokenAccounts, parseLightTokenCold, parseLightTokenHot, parseMaybeDelegatedTransfer, parseTokenData, removeMetadataKey, rentPerEpoch, revoke, revokeAccountsLayout, type revokeAccountsLayoutParams, revokeInterface, selectAccountsByPreferredTreeType, selectInputsForAmount, selectMinCompressedTokenAccountsForDecompression, selectMinCompressedTokenAccountsForTransfer, selectMinCompressedTokenAccountsForTransferOrPartial, selectSmartCompressedTokenAccountsForTransfer, selectSmartCompressedTokenAccountsForTransferOrPartial, selectSplInterfaceInfo, selectSplInterfaceInfosForDecompression, selectTokenAccountsForApprove, selectTokenPoolInfo, selectTokenPoolInfosForDecompression, serializeMint, sliceLast, sumUpTokenAmount, thawAccountsLayout, type thawAccountsLayoutParams, toAccountInfo, toOffChainMetadataJson, toTokenPoolInfo, transfer, transferAccountsLayout, type transferAccountsLayoutParams, transferDelegated, transferInterface, transferToAccountInterface, unpackMintData, unpackMintInterface, updateFreezeAuthority, updateMetadataAuthority, updateMetadataField, updateMintAuthority, validateSameTokenOwner, wrap };
@@ -1876,6 +1876,40 @@ declare function createLightTokenFreezeAccountInstruction(tokenAccount: PublicKe
1876
1876
  */
1877
1877
  declare function createLightTokenThawAccountInstruction(tokenAccount: PublicKey, mint: PublicKey, freezeAuthority: PublicKey): TransactionInstruction;
1878
1878
 
1879
+ /**
1880
+ * Create an instruction to approve a delegate for a light-token account.
1881
+ *
1882
+ * Account order per program:
1883
+ * 0. token_account (mutable) - the light-token account
1884
+ * 1. delegate (readonly) - the delegate to approve
1885
+ * 2. owner (signer) - owner of the token account
1886
+ * 3. system_program (readonly) - for rent top-ups via CPI
1887
+ * 4. fee_payer (mutable, signer) - pays for rent top-ups
1888
+ *
1889
+ * @param tokenAccount The light-token account to set delegation on
1890
+ * @param delegate The delegate to approve
1891
+ * @param owner Owner of the token account (signer)
1892
+ * @param amount Amount of tokens to delegate
1893
+ * @param feePayer Optional fee payer for rent top-ups (defaults to owner)
1894
+ * @returns TransactionInstruction
1895
+ */
1896
+ declare function createLightTokenApproveInstruction(tokenAccount: PublicKey, delegate: PublicKey, owner: PublicKey, amount: number | bigint, feePayer?: PublicKey): TransactionInstruction;
1897
+ /**
1898
+ * Create an instruction to revoke delegation for a light-token account.
1899
+ *
1900
+ * Account order per program:
1901
+ * 0. token_account (mutable) - the light-token account
1902
+ * 1. owner (signer) - owner of the token account
1903
+ * 2. system_program (readonly) - for rent top-ups via CPI
1904
+ * 3. fee_payer (mutable, signer) - pays for rent top-ups
1905
+ *
1906
+ * @param tokenAccount The light-token account to revoke delegation on
1907
+ * @param owner Owner of the token account (signer)
1908
+ * @param feePayer Optional fee payer for rent top-ups (defaults to owner)
1909
+ * @returns TransactionInstruction
1910
+ */
1911
+ declare function createLightTokenRevokeInstruction(tokenAccount: PublicKey, owner: PublicKey, feePayer?: PublicKey): TransactionInstruction;
1912
+
1879
1913
  /**
1880
1914
  * Create and initialize a new mint for SPL/T22/light-token.
1881
1915
  *
@@ -5466,20 +5500,27 @@ declare function loadAta(rpc: Rpc, ata: PublicKey, owner: Signer, mint: PublicKe
5466
5500
  /**
5467
5501
  * Transfer tokens using the unified ata interface.
5468
5502
  *
5469
- * Destination associated token account must exist. Automatically wraps SPL/T22 to light-token associated token account.
5503
+ * Destination ATA is derived from `recipient` and created idempotently.
5504
+ * Automatically wraps SPL/T22 to light-token associated token account.
5470
5505
  *
5471
5506
  * @param rpc RPC connection
5472
5507
  * @param payer Fee payer (signer)
5473
5508
  * @param source Source light-token associated token account address
5474
5509
  * @param mint Mint address
5475
- * @param destination Destination token account address (must exist; derive via getAssociatedTokenAddressInterface)
5510
+ * @param recipient Destination owner wallet address
5476
5511
  * @param owner Source owner (signer)
5477
5512
  * @param amount Amount to transfer
5478
5513
  * @param confirmOptions Optional confirm options
5479
5514
  * @param options Optional interface options
5480
5515
  * @returns Transaction signature
5481
5516
  */
5482
- declare function transferInterface(rpc: Rpc, payer: Signer, source: PublicKey, mint: PublicKey, destination: PublicKey, owner: Signer, amount: number | bigint | BN, confirmOptions?: ConfirmOptions, options?: InterfaceOptions, decimals?: number): Promise<string>;
5517
+ declare function transferInterface(rpc: Rpc, payer: Signer, source: PublicKey, mint: PublicKey, recipient: PublicKey, owner: Signer, amount: number | bigint | BN, confirmOptions?: ConfirmOptions, options?: InterfaceOptions, decimals?: number): Promise<string>;
5518
+ /**
5519
+ * Transfer tokens to an explicit destination token account.
5520
+ *
5521
+ * Use this for advanced routing to non-ATA destinations.
5522
+ */
5523
+ declare function transferToAccountInterface(rpc: Rpc, payer: Signer, source: PublicKey, mint: PublicKey, destination: PublicKey, owner: Signer, amount: number | bigint | BN, confirmOptions?: ConfirmOptions, options?: InterfaceOptions, decimals?: number): Promise<string>;
5483
5524
  /**
5484
5525
  * Get or create light-token ATA with unified balance detection and auto-loading.
5485
5526
  *
@@ -5513,13 +5554,20 @@ declare function getOrCreateAtaInterface(rpc: Rpc, payer: Signer, mint: PublicKe
5513
5554
  * Create transfer instructions for a unified token transfer.
5514
5555
  *
5515
5556
  * Unified variant: always wraps SPL/T22 to light-token associated token account.
5557
+ * Recipient must be an on-curve wallet address. For PDA/off-curve owners,
5558
+ * use createTransferToAccountInterfaceInstructions with an explicit destination ATA.
5516
5559
  *
5517
5560
  * Returns `TransactionInstruction[][]`. Send [0..n-2] in parallel, then [n-1].
5518
5561
  * Use `sliceLast` to separate the parallel prefix from the final transfer.
5519
5562
  *
5520
5563
  * @see createTransferInterfaceInstructions in v3/actions/transfer-interface.ts
5521
5564
  */
5522
- declare function createTransferInterfaceInstructions(rpc: Rpc, payer: PublicKey, mint: PublicKey, amount: number | bigint | BN, sender: PublicKey, destination: PublicKey, options?: Omit<TransferOptions, 'wrap'>): Promise<TransactionInstruction[][]>;
5565
+ declare function createTransferInterfaceInstructions(rpc: Rpc, payer: PublicKey, mint: PublicKey, amount: number | bigint | BN, sender: PublicKey, recipient: PublicKey, options?: Omit<TransferOptions, 'wrap'>): Promise<TransactionInstruction[][]>;
5566
+ /**
5567
+ * Create transfer instructions that route to an explicit destination token
5568
+ * account.
5569
+ */
5570
+ declare function createTransferToAccountInterfaceInstructions(rpc: Rpc, payer: PublicKey, mint: PublicKey, amount: number | bigint | BN, sender: PublicKey, destination: PublicKey, options?: Omit<TransferOptions, 'wrap'>): Promise<TransactionInstruction[][]>;
5523
5571
  /**
5524
5572
  * Build instruction batches for unwrapping light-tokens to SPL/T22.
5525
5573
  *
@@ -5559,4 +5607,64 @@ declare function createUnwrapInstructions(rpc: Rpc, destination: PublicKey, owne
5559
5607
  */
5560
5608
  declare function unwrap(rpc: Rpc, payer: Signer, destination: PublicKey, owner: Signer, mint: PublicKey, amount?: number | bigint | BN, splInterfaceInfo?: SplInterfaceInfo, confirmOptions?: ConfirmOptions, decimals?: number): Promise<string>;
5561
5609
 
5562
- export { ADD_TOKEN_POOL_DISCRIMINATOR, APPROVE_DISCRIMINATOR, type AccountInterface, Action, type AddSplInterfaceParams, type AddTokenPoolParams, type ApproveAndMintToParams, type ApproveParams, BASE_RENT_PER_EPOCH, BATCH_COMPRESS_DISCRIMINATOR, type BaseMint, type BatchCompressInstructionData, COMPRESSED_MINT_SEED, COMPRESSIBLE_LIGHT_TOKEN_ACCOUNT_SIZE, COMPRESSIBLE_LIGHT_TOKEN_RENT_PER_EPOCH, COMPRESSION_COST, COMPRESSION_INCENTIVE, COMPRESS_SPL_TOKEN_ACCOUNT_DISCRIMINATOR, CPI_AUTHORITY_SEED, CREATE_TOKEN_POOL_DISCRIMINATOR, type CompressParams, type CompressSplTokenAccountInstructionData, type CompressSplTokenAccountParams, type CompressedMint, type CompressedTokenInstructionDataApprove, CompressedTokenInstructionDataApproveLayout, type CompressedTokenInstructionDataRevoke, CompressedTokenInstructionDataRevokeLayout, type CompressedTokenInstructionDataTransfer, CompressedTokenInstructionDataTransferLayout, CompressedTokenProgram, type CompressibleConfig, CpiContextLayout, type CreateAssociatedLightTokenAccountParams, type CreateMintParams, type CreateSplInterfaceParams, type CreateTokenPoolParams, type CreateTokenProgramLookupTableParams, DEFAULT_COMPRESSIBLE_CONFIG, DEFAULT_PREPAY_EPOCHS, DEFAULT_WRITE_TOP_UP, type DecompressParams, type DelegatedTransfer, DelegatedTransferLayout, ERROR_MIXED_TREE_TYPES, ERROR_NO_ACCOUNTS_FOUND, ExtensionType, IDL, type InputTokenDataWithContext, type InterfaceOptions, LIGHT_TOKEN_CONFIG, LIGHT_TOKEN_RENT_SPONSOR, type LightCompressedToken, type LightTokenConfig, MAX_TOP_UP, MINT_TO_DISCRIMINATOR, type MergeTokenAccountsParams, type MintContext, type MintExtension, type MintInterface, type MintToInstructionData, type MintToParams, type OffChainTokenMetadata, type OffChainTokenMetadataJson, POOL_SEED, type PackCompressedTokenAccountsParams, type PackedTokenTransferOutputData, RENT_PER_BYTE_PER_EPOCH, REVOKE_DISCRIMINATOR, type RevokeParams, SLOTS_PER_RENT_EPOCH, SPL_TOKEN_MINT_RENT_EXEMPT_BALANCE, type SelectInputAccountsOptions, type SelectedAccountsResult, type SplInterfaceActivity, type SplInterfaceInfo, TOTAL_COMPRESSION_COST, TRANSFER_DISCRIMINATOR, type TokenAccountSource, type TokenData, TokenDataVersion, type TokenMetadata, type TokenMetadataInstructionData, type TokenPoolActivity, type TokenPoolInfo, type TokenTransferOutputData, type TransferOptions, type TransferParams, addSplInterfaces, addTokenPoolAccountsLayout, type addTokenPoolAccountsLayoutParams, addTokenPools, approve, approveAccountsLayout, type approveAccountsLayoutParams, approveAndMintTo, batchCompressLayout, calculateFeePayerCostAtCreation, checkMint, checkSplInterfaceInfo, checkTokenPoolInfo, compress, compressSplTokenAccount, compressSplTokenAccountInstructionDataLayout, convertTokenDataToAccount, createAssociatedLightTokenAccountIdempotentInstruction, createAssociatedLightTokenAccountInstruction, createAssociatedTokenAccountInterfaceIdempotentInstruction, createAssociatedTokenAccountInterfaceInstruction, createAtaInterface, createAtaInterfaceIdempotent, createAtaInterfaceIdempotentInstruction, createDecompressOutputState, createLightTokenFreezeAccountInstruction, createLightTokenThawAccountInstruction, createLightTokenTransferCheckedInstruction, createLightTokenTransferInstruction, createLoadAtaInstructions, createMint, createMintInstruction, createMintInterface, createMintToCompressedInstruction, createMintToInstruction, createMintToInterfaceInstruction, createRemoveMetadataKeyInstruction, createSplInterface, createTokenMetadata, createTokenPool, createTokenPoolAccountsLayout, type createTokenPoolAccountsLayoutParams, createTokenProgramLookupTable, createTransferInterfaceInstructions, createTransferOutputState, createUnwrapInstruction, createUnwrapInstructions, createUpdateFreezeAuthorityInstruction, createUpdateMetadataAuthorityInstruction, createUpdateMetadataFieldInstruction, createUpdateMintAuthorityInstruction, createWrapInstruction, decodeApproveInstructionData, decodeBatchCompressInstructionData, decodeCompressSplTokenAccountInstructionData, decodeMintToInstructionData, decodeRevokeInstructionData, decodeTokenMetadata, decodeTransferInstructionData, decompress, decompressDelegated, deriveCMintAddress, deriveSplInterfaceInfo, deriveTokenPoolInfo, deserializeMint, encodeApproveInstructionData, encodeBatchCompressInstructionData, encodeCompressSplTokenAccountInstructionData, encodeMintToInstructionData, encodeRevokeInstructionData, encodeTokenMetadata, encodeTransferInstructionData, extractTokenMetadata, findMintAddress, freezeAccountsLayout, type freezeAccountsLayoutParams, getAccountInterface, getAssociatedLightTokenAddress, getAssociatedLightTokenAddressAndBump, getAssociatedTokenAddressInterface, getAtaInterface, getMintInterface, getOrCreateAtaInterface, getSplInterfaceInfos, getTokenPoolInfos, groupAccountsByTreeType, isSingleSplInterfaceInfo, isSingleTokenPoolInfo, loadAta, mergeTokenAccounts, mintTo, mintToAccountsLayout, type mintToAccountsLayoutParams, mintToCompressed, mintToInterface, mintToLayout, mintTo$1 as mintToLightToken, packCompressedTokenAccounts, parseLightTokenCold, parseLightTokenHot, parseMaybeDelegatedTransfer, parseTokenData, removeMetadataKey, rentPerEpoch, revoke, revokeAccountsLayout, type revokeAccountsLayoutParams, selectAccountsByPreferredTreeType, selectMinCompressedTokenAccountsForDecompression, selectMinCompressedTokenAccountsForTransfer, selectMinCompressedTokenAccountsForTransferOrPartial, selectSmartCompressedTokenAccountsForTransfer, selectSmartCompressedTokenAccountsForTransferOrPartial, selectSplInterfaceInfo, selectSplInterfaceInfosForDecompression, selectTokenAccountsForApprove, selectTokenPoolInfo, selectTokenPoolInfosForDecompression, serializeMint, sliceLast, sumUpTokenAmount, thawAccountsLayout, type thawAccountsLayoutParams, toAccountInfo, toOffChainMetadataJson, toTokenPoolInfo, transfer, transferAccountsLayout, type transferAccountsLayoutParams, transferDelegated, transferInterface, unpackMintData, unpackMintInterface, unwrap, updateFreezeAuthority, updateMetadataAuthority, updateMetadataField, updateMintAuthority, validateSameTokenOwner, wrap };
5610
+ /**
5611
+ * Approve a delegate for an associated token account.
5612
+ *
5613
+ * Auto-detects mint type (light-token, SPL, or Token-2022) and dispatches
5614
+ * to the appropriate instruction.
5615
+ *
5616
+ * @remarks For light-token mints, all cold (compressed) balances are loaded
5617
+ * into the hot ATA, not just the delegation amount. The `amount` parameter
5618
+ * only controls the delegate's spending limit.
5619
+ *
5620
+ * @param rpc RPC connection
5621
+ * @param payer Fee payer (signer)
5622
+ * @param tokenAccount ATA address
5623
+ * @param mint Mint address
5624
+ * @param delegate Delegate to approve
5625
+ * @param amount Amount to delegate
5626
+ * @param owner Owner of the token account (signer)
5627
+ * @param confirmOptions Optional confirm options
5628
+ * @returns Transaction signature
5629
+ */
5630
+ declare function approveInterface(rpc: Rpc, payer: Signer, tokenAccount: PublicKey, mint: PublicKey, delegate: PublicKey, amount: number | bigint | BN, owner: Signer, confirmOptions?: ConfirmOptions, options?: InterfaceOptions, decimals?: number): Promise<string>;
5631
+ /**
5632
+ * Build instruction batches for approving a delegate on an ATA.
5633
+ *
5634
+ * Auto-detects mint type (light-token, SPL, or Token-2022).
5635
+ *
5636
+ * @remarks For light-token mints, all cold (compressed) balances are loaded
5637
+ * into the hot ATA before the approve instruction. The `amount` parameter
5638
+ * only controls the delegate's spending limit, not the number of accounts
5639
+ * loaded.
5640
+ */
5641
+ declare function createApproveInterfaceInstructions(rpc: Rpc, payer: PublicKey, mint: PublicKey, tokenAccount: PublicKey, delegate: PublicKey, amount: number | bigint | BN, owner: PublicKey, decimals?: number, options?: InterfaceOptions): Promise<TransactionInstruction[][]>;
5642
+ /**
5643
+ * Revoke delegation for an associated token account.
5644
+ *
5645
+ * Auto-detects mint type (light-token, SPL, or Token-2022) and dispatches
5646
+ * to the appropriate instruction.
5647
+ *
5648
+ * @remarks For light-token mints, all cold (compressed) balances are loaded
5649
+ * into the hot ATA before the revoke instruction.
5650
+ *
5651
+ * @param rpc RPC connection
5652
+ * @param payer Fee payer (signer)
5653
+ * @param tokenAccount ATA address
5654
+ * @param mint Mint address
5655
+ * @param owner Owner of the token account (signer)
5656
+ * @param confirmOptions Optional confirm options
5657
+ * @returns Transaction signature
5658
+ */
5659
+ declare function revokeInterface(rpc: Rpc, payer: Signer, tokenAccount: PublicKey, mint: PublicKey, owner: Signer, confirmOptions?: ConfirmOptions, options?: InterfaceOptions, decimals?: number): Promise<string>;
5660
+ /**
5661
+ * Build instruction batches for revoking delegation on an ATA.
5662
+ *
5663
+ * Auto-detects mint type (light-token, SPL, or Token-2022).
5664
+ *
5665
+ * @remarks For light-token mints, all cold (compressed) balances are loaded
5666
+ * into the hot ATA before the revoke instruction.
5667
+ */
5668
+ declare function createRevokeInterfaceInstructions(rpc: Rpc, payer: PublicKey, mint: PublicKey, tokenAccount: PublicKey, owner: PublicKey, decimals?: number, options?: InterfaceOptions): Promise<TransactionInstruction[][]>;
5669
+
5670
+ export { ADD_TOKEN_POOL_DISCRIMINATOR, APPROVE_DISCRIMINATOR, type AccountInterface, Action, type AddSplInterfaceParams, type AddTokenPoolParams, type ApproveAndMintToParams, type ApproveParams, BASE_RENT_PER_EPOCH, BATCH_COMPRESS_DISCRIMINATOR, type BaseMint, type BatchCompressInstructionData, COMPRESSED_MINT_SEED, COMPRESSIBLE_LIGHT_TOKEN_ACCOUNT_SIZE, COMPRESSIBLE_LIGHT_TOKEN_RENT_PER_EPOCH, COMPRESSION_COST, COMPRESSION_INCENTIVE, COMPRESS_SPL_TOKEN_ACCOUNT_DISCRIMINATOR, CPI_AUTHORITY_SEED, CREATE_TOKEN_POOL_DISCRIMINATOR, type CompressParams, type CompressSplTokenAccountInstructionData, type CompressSplTokenAccountParams, type CompressedMint, type CompressedTokenInstructionDataApprove, CompressedTokenInstructionDataApproveLayout, type CompressedTokenInstructionDataRevoke, CompressedTokenInstructionDataRevokeLayout, type CompressedTokenInstructionDataTransfer, CompressedTokenInstructionDataTransferLayout, CompressedTokenProgram, type CompressibleConfig, CpiContextLayout, type CreateAssociatedLightTokenAccountParams, type CreateMintParams, type CreateSplInterfaceParams, type CreateTokenPoolParams, type CreateTokenProgramLookupTableParams, DEFAULT_COMPRESSIBLE_CONFIG, DEFAULT_PREPAY_EPOCHS, DEFAULT_WRITE_TOP_UP, type DecompressParams, type DelegatedTransfer, DelegatedTransferLayout, ERROR_MIXED_TREE_TYPES, ERROR_NO_ACCOUNTS_FOUND, ExtensionType, IDL, type InputTokenDataWithContext, type InterfaceOptions, LIGHT_TOKEN_CONFIG, LIGHT_TOKEN_RENT_SPONSOR, type LightCompressedToken, type LightTokenConfig, MAX_TOP_UP, MINT_TO_DISCRIMINATOR, type MergeTokenAccountsParams, type MintContext, type MintExtension, type MintInterface, type MintToInstructionData, type MintToParams, type OffChainTokenMetadata, type OffChainTokenMetadataJson, POOL_SEED, type PackCompressedTokenAccountsParams, type PackedTokenTransferOutputData, RENT_PER_BYTE_PER_EPOCH, REVOKE_DISCRIMINATOR, type RevokeParams, SLOTS_PER_RENT_EPOCH, SPL_TOKEN_MINT_RENT_EXEMPT_BALANCE, type SelectInputAccountsOptions, type SelectedAccountsResult, type SplInterfaceActivity, type SplInterfaceInfo, TOTAL_COMPRESSION_COST, TRANSFER_DISCRIMINATOR, type TokenAccountSource, type TokenData, TokenDataVersion, type TokenMetadata, type TokenMetadataInstructionData, type TokenPoolActivity, type TokenPoolInfo, type TokenTransferOutputData, type TransferOptions, type TransferParams, type TransferOptions as TransferToAccountOptions, addSplInterfaces, addTokenPoolAccountsLayout, type addTokenPoolAccountsLayoutParams, addTokenPools, approve, approveAccountsLayout, type approveAccountsLayoutParams, approveAndMintTo, approveInterface, batchCompressLayout, calculateFeePayerCostAtCreation, checkMint, checkSplInterfaceInfo, checkTokenPoolInfo, compress, compressSplTokenAccount, compressSplTokenAccountInstructionDataLayout, convertTokenDataToAccount, createApproveInterfaceInstructions, createAssociatedLightTokenAccountIdempotentInstruction, createAssociatedLightTokenAccountInstruction, createAssociatedTokenAccountInterfaceIdempotentInstruction, createAssociatedTokenAccountInterfaceInstruction, createAtaInterface, createAtaInterfaceIdempotent, createAtaInterfaceIdempotentInstruction, createDecompressOutputState, createLightTokenApproveInstruction, createLightTokenFreezeAccountInstruction, createLightTokenRevokeInstruction, createLightTokenThawAccountInstruction, createLightTokenTransferCheckedInstruction, createLightTokenTransferInstruction, createLoadAtaInstructions, createMint, createMintInstruction, createMintInterface, createMintToCompressedInstruction, createMintToInstruction, createMintToInterfaceInstruction, createRemoveMetadataKeyInstruction, createRevokeInterfaceInstructions, createSplInterface, createTokenMetadata, createTokenPool, createTokenPoolAccountsLayout, type createTokenPoolAccountsLayoutParams, createTokenProgramLookupTable, createTransferInterfaceInstructions, createTransferOutputState, createTransferToAccountInterfaceInstructions, createUnwrapInstruction, createUnwrapInstructions, createUpdateFreezeAuthorityInstruction, createUpdateMetadataAuthorityInstruction, createUpdateMetadataFieldInstruction, createUpdateMintAuthorityInstruction, createWrapInstruction, decodeApproveInstructionData, decodeBatchCompressInstructionData, decodeCompressSplTokenAccountInstructionData, decodeMintToInstructionData, decodeRevokeInstructionData, decodeTokenMetadata, decodeTransferInstructionData, decompress, decompressDelegated, deriveCMintAddress, deriveSplInterfaceInfo, deriveTokenPoolInfo, deserializeMint, encodeApproveInstructionData, encodeBatchCompressInstructionData, encodeCompressSplTokenAccountInstructionData, encodeMintToInstructionData, encodeRevokeInstructionData, encodeTokenMetadata, encodeTransferInstructionData, extractTokenMetadata, findMintAddress, freezeAccountsLayout, type freezeAccountsLayoutParams, getAccountInterface, getAssociatedLightTokenAddress, getAssociatedLightTokenAddressAndBump, getAssociatedTokenAddressInterface, getAtaInterface, getMintInterface, getOrCreateAtaInterface, getSplInterfaceInfos, getTokenPoolInfos, groupAccountsByTreeType, isSingleSplInterfaceInfo, isSingleTokenPoolInfo, loadAta, mergeTokenAccounts, mintTo, mintToAccountsLayout, type mintToAccountsLayoutParams, mintToCompressed, mintToInterface, mintToLayout, mintTo$1 as mintToLightToken, packCompressedTokenAccounts, parseLightTokenCold, parseLightTokenHot, parseMaybeDelegatedTransfer, parseTokenData, removeMetadataKey, rentPerEpoch, revoke, revokeAccountsLayout, type revokeAccountsLayoutParams, revokeInterface, selectAccountsByPreferredTreeType, selectMinCompressedTokenAccountsForDecompression, selectMinCompressedTokenAccountsForTransfer, selectMinCompressedTokenAccountsForTransferOrPartial, selectSmartCompressedTokenAccountsForTransfer, selectSmartCompressedTokenAccountsForTransferOrPartial, selectSplInterfaceInfo, selectSplInterfaceInfosForDecompression, selectTokenAccountsForApprove, selectTokenPoolInfo, selectTokenPoolInfosForDecompression, serializeMint, sliceLast, sumUpTokenAmount, thawAccountsLayout, type thawAccountsLayoutParams, toAccountInfo, toOffChainMetadataJson, toTokenPoolInfo, transfer, transferAccountsLayout, type transferAccountsLayoutParams, transferDelegated, transferInterface, transferToAccountInterface, unpackMintData, unpackMintInterface, unwrap, updateFreezeAuthority, updateMetadataAuthority, updateMetadataField, updateMintAuthority, validateSameTokenOwner, wrap };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightprotocol/compressed-token",
3
- "version": "0.23.0-beta.10",
3
+ "version": "0.23.0-beta.11",
4
4
  "description": "JS client to interact with the compressed-token program",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/node/index.cjs",
@@ -42,7 +42,7 @@
42
42
  "@coral-xyz/borsh": "^0.29.0",
43
43
  "@solana/spl-token": ">=0.3.9",
44
44
  "@solana/web3.js": ">=1.73.5",
45
- "@lightprotocol/stateless.js": "0.23.0-beta.10"
45
+ "@lightprotocol/stateless.js": "0.23.0-beta.11"
46
46
  },
47
47
  "dependencies": {
48
48
  "@solana/buffer-layout": "^4.0.1",