@lightprotocol/compressed-token 0.23.0-beta.8 → 0.23.0

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,6 +1,6 @@
1
1
  /// <reference types="node" />
2
- import { PublicKey, TransactionInstruction, Commitment, AccountInfo, Signer, ConfirmOptions, TransactionSignature, AccountMeta, Keypair, Connection } from '@solana/web3.js';
3
- import { ValidityProofWithContext, AddressTreeInfo, TreeInfo, MerkleContext, Rpc, ParsedTokenAccount, CompressedAccountWithMerkleContext, ValidityProof, TreeType, PackedMerkleContextLegacy, CompressedCpiContext, InputTokenDataWithContext as InputTokenDataWithContext$1, CompressedProof } from '@lightprotocol/stateless.js';
2
+ import { PublicKey, TransactionInstruction, Commitment, AccountInfo, Signer, ConfirmOptions, TransactionSignature, Keypair, AccountMeta, Connection } from '@solana/web3.js';
3
+ import { ValidityProofWithContext, AddressTreeInfo, TreeInfo, MerkleContext, Rpc, CompressedAccountWithMerkleContext, ParsedTokenAccount, TreeType, PackedMerkleContextLegacy, CompressedCpiContext, ValidityProof, InputTokenDataWithContext as InputTokenDataWithContext$1, CompressedProof } from '@lightprotocol/stateless.js';
4
4
  export { ParsedTokenAccount as ParsedTokenAccountInterface } from '@lightprotocol/stateless.js';
5
5
  import { Mint, Account } from '@solana/spl-token';
6
6
  export { Account, AccountState } from '@solana/spl-token';
@@ -339,7 +339,7 @@ interface AdditionalMetadata {
339
339
  }
340
340
 
341
341
  /**
342
- * Token metadata for creating a c-token mint.
342
+ * Token metadata for creating a light-token mint.
343
343
  */
344
344
  interface TokenMetadataInstructionData {
345
345
  name: string;
@@ -350,7 +350,7 @@ interface TokenMetadataInstructionData {
350
350
  }
351
351
  declare function createTokenMetadata(name: string, symbol: string, uri: string, updateAuthority?: PublicKey | null, additionalMetadata?: AdditionalMetadata[] | null): TokenMetadataInstructionData;
352
352
  /**
353
- * Create instruction for initializing a c-token mint.
353
+ * Create instruction for initializing a light-token mint.
354
354
  *
355
355
  * @param mintSigner Mint signer keypair public key.
356
356
  * @param decimals Number of decimals for the mint.
@@ -361,8 +361,9 @@ declare function createTokenMetadata(name: string, symbol: string, uri: string,
361
361
  * @param addressTreeInfo Address tree info for the mint.
362
362
  * @param outputStateTreeInfo Output state tree info.
363
363
  * @param metadata Optional token metadata.
364
+ * @param maxTopUp Optional cap on rent top-up (units of 1k lamports; default no cap)
364
365
  */
365
- declare function createMintInstruction(mintSigner: PublicKey, decimals: number, mintAuthority: PublicKey, freezeAuthority: PublicKey | null, payer: PublicKey, validityProof: ValidityProofWithContext, addressTreeInfo: AddressTreeInfo, outputStateTreeInfo: TreeInfo, metadata?: TokenMetadataInstructionData): TransactionInstruction;
366
+ declare function createMintInstruction(mintSigner: PublicKey, decimals: number, mintAuthority: PublicKey, freezeAuthority: PublicKey | null, payer: PublicKey, validityProof: ValidityProofWithContext, addressTreeInfo: AddressTreeInfo, outputStateTreeInfo: TreeInfo, metadata?: TokenMetadataInstructionData, maxTopUp?: number): TransactionInstruction;
366
367
 
367
368
  /**
368
369
  * SPL-compatible base mint structure
@@ -380,12 +381,12 @@ interface BaseMint {
380
381
  freezeAuthority: PublicKey | null;
381
382
  }
382
383
  /**
383
- * Compressed mint context (protocol version, SPL mint reference)
384
+ * Light mint context (protocol version, SPL mint reference)
384
385
  */
385
386
  interface MintContext {
386
387
  /** Protocol version for upgradability */
387
388
  version: number;
388
- /** Whether the compressed mint is decompressed to a CMint Solana account */
389
+ /** Whether the compressed light mint has been decompressed to a light mint account */
389
390
  cmintDecompressed: boolean;
390
391
  /** PDA of the associated SPL mint */
391
392
  splMint: PublicKey;
@@ -423,7 +424,7 @@ interface TokenMetadata {
423
424
  }[];
424
425
  }
425
426
  /**
426
- * Complete compressed mint structure (raw format)
427
+ * Complete light mint structure (raw format)
427
428
  */
428
429
  interface CompressedMint {
429
430
  base: BaseMint;
@@ -452,7 +453,7 @@ interface RentConfig {
452
453
  maxTopUp: number;
453
454
  }
454
455
  /**
455
- * Compression info embedded in CompressedMint
456
+ * Compression info embedded in light mint
456
457
  */
457
458
  interface CompressionInfo {
458
459
  /** Config account version (0 = uninitialized) */
@@ -477,18 +478,18 @@ interface CompressionInfo {
477
478
  rentConfig: RentConfig;
478
479
  }
479
480
  /**
480
- * Deserialize a compressed mint from buffer
481
+ * Deserialize a light mint from buffer
481
482
  * Uses SPL's MintLayout for BaseMint and buffer-layout struct for context
482
483
  *
483
484
  * @param data - The raw account data buffer
484
- * @returns The deserialized CompressedMint
485
+ * @returns The deserialized light mint
485
486
  */
486
487
  declare function deserializeMint(data: Buffer$1 | Uint8Array): CompressedMint;
487
488
  /**
488
- * Serialize a CompressedMint to buffer
489
+ * Serialize a light mint to buffer
489
490
  * Uses SPL's MintLayout for BaseMint, helper functions for context/metadata
490
491
  *
491
- * @param mint - The CompressedMint to serialize
492
+ * @param mint - The light mint to serialize
492
493
  * @returns The serialized buffer
493
494
  */
494
495
  declare function serializeMint(mint: CompressedMint): Buffer$1;
@@ -551,11 +552,11 @@ interface MintInterface {
551
552
  mintContext?: MintContext;
552
553
  tokenMetadata?: TokenMetadata;
553
554
  extensions?: MintExtension[];
554
- /** Compression info for c-token mints */
555
+ /** Compression info for light-token mints */
555
556
  compression?: CompressionInfo;
556
557
  }
557
558
  /**
558
- * Get unified mint info for SPL/T22/c-token mints.
559
+ * Get unified mint info for SPL/T22/light-token mints.
559
560
  *
560
561
  * @param rpc RPC connection
561
562
  * @param address The mint address
@@ -567,16 +568,16 @@ interface MintInterface {
567
568
  */
568
569
  declare function getMintInterface(rpc: Rpc, address: PublicKey, commitment?: Commitment, programId?: PublicKey): Promise<MintInterface>;
569
570
  /**
570
- * Unpack mint info from raw account data for SPL/T22/c-token.
571
+ * Unpack mint info from raw account data for SPL/T22/light-token.
571
572
  *
572
573
  * @param address The mint pubkey
573
574
  * @param data The raw account data or AccountInfo
574
- * @param programId Token program ID. Default c-token.
575
+ * @param programId Token program ID. Default light-token.
575
576
  * @returns Object with mint, optional mintContext and tokenMetadata.
576
577
  */
577
578
  declare function unpackMintInterface(address: PublicKey, data: Buffer$1 | Uint8Array | AccountInfo<Buffer$1>, programId?: PublicKey): Omit<MintInterface, 'merkleContext'>;
578
579
  /**
579
- * Unpack c-token mint context and metadata from raw account data
580
+ * Unpack light-token mint context and metadata from raw account data
580
581
  *
581
582
  * @param data The raw account data
582
583
  * @returns Object with mintContext, tokenMetadata, and extensions
@@ -588,19 +589,20 @@ declare function unpackMintData(data: Buffer$1 | Uint8Array): {
588
589
  };
589
590
 
590
591
  /**
591
- * Create instruction for updating a compressed mint's mint authority.
592
- * Works for both compressed and decompressed mints.
592
+ * Create instruction for updating a light mint's mint authority.
593
+ * Works for both compressed and decompressed light mints.
593
594
  *
594
595
  * @param mintInterface MintInterface from getMintInterface() - must have merkleContext
595
596
  * @param currentMintAuthority Current mint authority public key (must sign)
596
597
  * @param newMintAuthority New mint authority (or null to revoke)
597
598
  * @param payer Fee payer public key
598
- * @param validityProof Validity proof for the compressed mint (null for decompressed mints)
599
+ * @param validityProof Validity proof for the compressed light mint (null for decompressed light mints)
600
+ * @param maxTopUp Optional cap on rent top-up (units of 1k lamports; default no cap)
599
601
  */
600
- declare function createUpdateMintAuthorityInstruction(mintInterface: MintInterface, currentMintAuthority: PublicKey, newMintAuthority: PublicKey | null, payer: PublicKey, validityProof: ValidityProofWithContext | null): TransactionInstruction;
602
+ declare function createUpdateMintAuthorityInstruction(mintInterface: MintInterface, currentMintAuthority: PublicKey, newMintAuthority: PublicKey | null, payer: PublicKey, validityProof: ValidityProofWithContext | null, maxTopUp?: number): TransactionInstruction;
601
603
  /**
602
- * Create instruction for updating a compressed mint's freeze authority.
603
- * Works for both compressed and decompressed mints.
604
+ * Create instruction for updating a light mint's freeze authority.
605
+ * Works for both compressed and decompressed light mints.
604
606
  *
605
607
  * Output queue is automatically derived from mintInterface.merkleContext.treeInfo
606
608
  * (preferring nextTreeInfo.queue if available for rollover support).
@@ -609,12 +611,13 @@ declare function createUpdateMintAuthorityInstruction(mintInterface: MintInterfa
609
611
  * @param currentFreezeAuthority Current freeze authority public key (must sign)
610
612
  * @param newFreezeAuthority New freeze authority (or null to revoke)
611
613
  * @param payer Fee payer public key
612
- * @param validityProof Validity proof for the compressed mint (null for decompressed mints)
614
+ * @param validityProof Validity proof for the compressed light mint (null for decompressed light mints)
615
+ * @param maxTopUp Optional cap on rent top-up (units of 1k lamports; default no cap)
613
616
  */
614
- declare function createUpdateFreezeAuthorityInstruction(mintInterface: MintInterface, currentFreezeAuthority: PublicKey, newFreezeAuthority: PublicKey | null, payer: PublicKey, validityProof: ValidityProofWithContext | null): TransactionInstruction;
617
+ declare function createUpdateFreezeAuthorityInstruction(mintInterface: MintInterface, currentFreezeAuthority: PublicKey, newFreezeAuthority: PublicKey | null, payer: PublicKey, validityProof: ValidityProofWithContext | null, maxTopUp?: number): TransactionInstruction;
615
618
 
616
619
  /**
617
- * Create instruction for updating a compressed mint's metadata field.
620
+ * Create instruction for updating a light mint's metadata field.
618
621
  *
619
622
  * Output queue is automatically derived from mintInterface.merkleContext.treeInfo
620
623
  * (preferring nextTreeInfo.queue if available for rollover support).
@@ -622,15 +625,16 @@ declare function createUpdateFreezeAuthorityInstruction(mintInterface: MintInter
622
625
  * @param mintInterface MintInterface from getMintInterface() - must have merkleContext and tokenMetadata
623
626
  * @param authority Metadata update authority public key (must sign)
624
627
  * @param payer Fee payer public key
625
- * @param validityProof Validity proof for the compressed mint (null for decompressed mints)
628
+ * @param validityProof Validity proof for the light mint (null for decompressed light mints)
626
629
  * @param fieldType Field to update: 'name', 'symbol', 'uri', or 'custom'
627
630
  * @param value New value for the field
628
631
  * @param customKey Custom key name (required if fieldType is 'custom')
629
632
  * @param extensionIndex Extension index (default: 0)
633
+ * @param maxTopUp Optional cap on rent top-up (units of 1k lamports; default no cap)
630
634
  */
631
- declare function createUpdateMetadataFieldInstruction(mintInterface: MintInterface, authority: PublicKey, payer: PublicKey, validityProof: ValidityProofWithContext | null, fieldType: 'name' | 'symbol' | 'uri' | 'custom', value: string, customKey?: string, extensionIndex?: number): TransactionInstruction;
635
+ declare function createUpdateMetadataFieldInstruction(mintInterface: MintInterface, authority: PublicKey, payer: PublicKey, validityProof: ValidityProofWithContext | null, fieldType: 'name' | 'symbol' | 'uri' | 'custom', value: string, customKey?: string, extensionIndex?: number, maxTopUp?: number): TransactionInstruction;
632
636
  /**
633
- * Create instruction for updating a compressed mint's metadata authority.
637
+ * Create instruction for updating a light mint's metadata authority.
634
638
  *
635
639
  * Output queue is automatically derived from mintInterface.merkleContext.treeInfo
636
640
  * (preferring nextTreeInfo.queue if available for rollover support).
@@ -639,12 +643,13 @@ declare function createUpdateMetadataFieldInstruction(mintInterface: MintInterfa
639
643
  * @param currentAuthority Current metadata update authority public key (must sign)
640
644
  * @param newAuthority New metadata update authority public key
641
645
  * @param payer Fee payer public key
642
- * @param validityProof Validity proof for the compressed mint (null for decompressed mints)
646
+ * @param validityProof Validity proof for the light mint (null for decompressed light mints)
643
647
  * @param extensionIndex Extension index (default: 0)
648
+ * @param maxTopUp Optional cap on rent top-up (units of 1k lamports; default no cap)
644
649
  */
645
- declare function createUpdateMetadataAuthorityInstruction(mintInterface: MintInterface, currentAuthority: PublicKey, newAuthority: PublicKey, payer: PublicKey, validityProof: ValidityProofWithContext | null, extensionIndex?: number): TransactionInstruction;
650
+ declare function createUpdateMetadataAuthorityInstruction(mintInterface: MintInterface, currentAuthority: PublicKey, newAuthority: PublicKey, payer: PublicKey, validityProof: ValidityProofWithContext | null, extensionIndex?: number, maxTopUp?: number): TransactionInstruction;
646
651
  /**
647
- * Create instruction for removing a metadata key from a compressed mint.
652
+ * Create instruction for removing a metadata key from a light mint.
648
653
  *
649
654
  * Output queue is automatically derived from mintInterface.merkleContext.treeInfo
650
655
  * (preferring nextTreeInfo.queue if available for rollover support).
@@ -652,12 +657,13 @@ declare function createUpdateMetadataAuthorityInstruction(mintInterface: MintInt
652
657
  * @param mintInterface MintInterface from getMintInterface() - must have merkleContext and tokenMetadata
653
658
  * @param authority Metadata update authority public key (must sign)
654
659
  * @param payer Fee payer public key
655
- * @param validityProof Validity proof for the compressed mint (null for decompressed mints)
660
+ * @param validityProof Validity proof for the light mint (null for decompressed light mints)
656
661
  * @param key Metadata key to remove
657
662
  * @param idempotent If true, don't error if key doesn't exist (default: false)
658
663
  * @param extensionIndex Extension index (default: 0)
664
+ * @param maxTopUp Optional cap on rent top-up (units of 1k lamports; default no cap)
659
665
  */
660
- declare function createRemoveMetadataKeyInstruction(mintInterface: MintInterface, authority: PublicKey, payer: PublicKey, validityProof: ValidityProofWithContext | null, key: string, idempotent?: boolean, extensionIndex?: number): TransactionInstruction;
666
+ declare function createRemoveMetadataKeyInstruction(mintInterface: MintInterface, authority: PublicKey, payer: PublicKey, validityProof: ValidityProofWithContext | null, key: string, idempotent?: boolean, extensionIndex?: number, maxTopUp?: number): TransactionInstruction;
661
667
 
662
668
  interface CompressToPubkey {
663
669
  bump: number;
@@ -671,11 +677,11 @@ interface CompressibleConfig {
671
677
  writeTopUp: number;
672
678
  compressToAccountPubkey?: CompressToPubkey | null;
673
679
  }
674
- interface CreateAssociatedCTokenAccountParams {
680
+ interface CreateAssociatedLightTokenAccountParams {
675
681
  compressibleConfig?: CompressibleConfig | null;
676
682
  }
677
683
  /**
678
- * Default compressible config for c-token ATAs - matches Rust SDK defaults.
684
+ * Default compressible config for light-token ATAs - matches Rust SDK defaults.
679
685
  *
680
686
  * - tokenAccountVersion: 3 (ShaFlat) - latest hashing scheme
681
687
  * - rentPayment: 16 - prepay 16 epochs (~24 hours rent)
@@ -683,7 +689,7 @@ interface CreateAssociatedCTokenAccountParams {
683
689
  * - writeTopUp: 766 - per-write top-up (~2 epochs rent) when rent < 2 epochs
684
690
  * - compressToAccountPubkey: null - required for ATAs
685
691
  *
686
- * Cost breakdown at ATA creation:
692
+ * Cost breakdown at associated token account creation:
687
693
  * - Rent sponsor PDA (LIGHT_TOKEN_RENT_SPONSOR) pays: rent exemption (~890,880 lamports)
688
694
  * - Fee payer pays: compression_cost (11K) + 16 epochs rent (~6,400) = ~17,400 lamports + tx fees
689
695
  *
@@ -691,7 +697,7 @@ interface CreateAssociatedCTokenAccountParams {
691
697
  * - When account rent is below 2 epochs, fee payer pays 766 lamports top-up
692
698
  * - This keeps the account perpetually funded when actively used
693
699
  *
694
- * Rent calculation (272-byte compressible ctoken account):
700
+ * Rent calculation (272-byte compressible lightToken account):
695
701
  * - rent_per_epoch = base_rent (128) + bytes * rent_per_byte (272 * 1) = 400 lamports
696
702
  * - 16 epochs = 16 * 400 = 6,400 lamports (24 hours)
697
703
  * - 2 epochs = 2 * 400 = 800 lamports (~3 hours, writeTopUp = 766 is conservative)
@@ -707,7 +713,7 @@ interface CreateAssociatedCTokenAccountParams {
707
713
  */
708
714
  declare const DEFAULT_COMPRESSIBLE_CONFIG: CompressibleConfig;
709
715
  /**
710
- * Create instruction for creating an associated compressed token account.
716
+ * Create instruction for creating an associated light-token account.
711
717
  * Uses the default rent sponsor PDA by default.
712
718
  *
713
719
  * @param feePayer Fee payer public key.
@@ -717,9 +723,9 @@ declare const DEFAULT_COMPRESSIBLE_CONFIG: CompressibleConfig;
717
723
  * @param configAccount Config account (defaults to LIGHT_TOKEN_CONFIG).
718
724
  * @param rentPayerPda Rent payer PDA (defaults to LIGHT_TOKEN_RENT_SPONSOR).
719
725
  */
720
- declare function createAssociatedCTokenAccountInstruction(feePayer: PublicKey, owner: PublicKey, mint: PublicKey, compressibleConfig?: CompressibleConfig | null, configAccount?: PublicKey, rentPayerPda?: PublicKey): TransactionInstruction;
726
+ declare function createAssociatedLightTokenAccountInstruction(feePayer: PublicKey, owner: PublicKey, mint: PublicKey, compressibleConfig?: CompressibleConfig | null, configAccount?: PublicKey, rentPayerPda?: PublicKey): TransactionInstruction;
721
727
  /**
722
- * Create idempotent instruction for creating an associated compressed token account.
728
+ * Create idempotent instruction for creating an associated light-token account.
723
729
  * Uses the default rent sponsor PDA by default.
724
730
  *
725
731
  * @param feePayer Fee payer public key.
@@ -729,19 +735,19 @@ declare function createAssociatedCTokenAccountInstruction(feePayer: PublicKey, o
729
735
  * @param configAccount Config account (defaults to LIGHT_TOKEN_CONFIG).
730
736
  * @param rentPayerPda Rent payer PDA (defaults to LIGHT_TOKEN_RENT_SPONSOR).
731
737
  */
732
- declare function createAssociatedCTokenAccountIdempotentInstruction(feePayer: PublicKey, owner: PublicKey, mint: PublicKey, compressibleConfig?: CompressibleConfig | null, configAccount?: PublicKey, rentPayerPda?: PublicKey): TransactionInstruction;
738
+ declare function createAssociatedLightTokenAccountIdempotentInstruction(feePayer: PublicKey, owner: PublicKey, mint: PublicKey, compressibleConfig?: CompressibleConfig | null, configAccount?: PublicKey, rentPayerPda?: PublicKey): TransactionInstruction;
733
739
 
734
740
  /**
735
- * c-token-specific config for createAssociatedTokenAccountInterfaceInstruction
741
+ * light-token-specific config for createAssociatedTokenAccountInterfaceInstruction
736
742
  */
737
- interface CTokenConfig {
743
+ interface LightTokenConfig {
738
744
  compressibleConfig?: CompressibleConfig | null;
739
745
  configAccount?: PublicKey;
740
746
  rentPayerPda?: PublicKey;
741
747
  }
742
748
  /**
743
749
  * Create instruction for creating an associated token account (SPL, Token-2022,
744
- * or c-token). Follows SPL Token API signature with optional c-token config at the
750
+ * or light-token). Follows SPL Token API signature with optional light-token config at the
745
751
  * end.
746
752
  *
747
753
  * @param payer Fee payer public key.
@@ -750,12 +756,12 @@ interface CTokenConfig {
750
756
  * @param mint Mint address.
751
757
  * @param programId Token program ID (default: TOKEN_PROGRAM_ID).
752
758
  * @param associatedTokenProgramId Associated token program ID.
753
- * @param ctokenConfig Optional c-token-specific configuration.
759
+ * @param lightTokenConfig Optional light-token-specific configuration.
754
760
  */
755
- declare function createAssociatedTokenAccountInterfaceInstruction(payer: PublicKey, associatedToken: PublicKey, owner: PublicKey, mint: PublicKey, programId?: PublicKey, associatedTokenProgramId?: PublicKey, ctokenConfig?: CTokenConfig): TransactionInstruction;
761
+ declare function createAssociatedTokenAccountInterfaceInstruction(payer: PublicKey, associatedToken: PublicKey, owner: PublicKey, mint: PublicKey, programId?: PublicKey, associatedTokenProgramId?: PublicKey, lightTokenConfig?: LightTokenConfig): TransactionInstruction;
756
762
  /**
757
763
  * Create idempotent instruction for creating an associated token account (SPL,
758
- * Token-2022, or c-token). Follows SPL Token API signature with optional c-token
764
+ * Token-2022, or light-token). Follows SPL Token API signature with optional light-token
759
765
  * config at the end.
760
766
  *
761
767
  * @param payer Fee payer public key.
@@ -764,164 +770,14 @@ declare function createAssociatedTokenAccountInterfaceInstruction(payer: PublicK
764
770
  * @param mint Mint address.
765
771
  * @param programId Token program ID (default: TOKEN_PROGRAM_ID).
766
772
  * @param associatedTokenProgramId Associated token program ID.
767
- * @param ctokenConfig Optional c-token-specific configuration.
773
+ * @param lightTokenConfig Optional light-token-specific configuration.
768
774
  */
769
- declare function createAssociatedTokenAccountInterfaceIdempotentInstruction(payer: PublicKey, associatedToken: PublicKey, owner: PublicKey, mint: PublicKey, programId?: PublicKey, associatedTokenProgramId?: PublicKey, ctokenConfig?: CTokenConfig): TransactionInstruction;
775
+ declare function createAssociatedTokenAccountInterfaceIdempotentInstruction(payer: PublicKey, associatedToken: PublicKey, owner: PublicKey, mint: PublicKey, programId?: PublicKey, associatedTokenProgramId?: PublicKey, lightTokenConfig?: LightTokenConfig): TransactionInstruction;
770
776
  /**
771
777
  * Short alias for createAssociatedTokenAccountInterfaceIdempotentInstruction.
772
778
  */
773
779
  declare const createAtaInterfaceIdempotentInstruction: typeof createAssociatedTokenAccountInterfaceIdempotentInstruction;
774
780
 
775
- /**
776
- * Parameters for creating a MintTo instruction.
777
- */
778
- interface CreateMintToInstructionParams {
779
- /** Mint account (CMint - decompressed compressed mint) */
780
- mint: PublicKey;
781
- /** Destination CToken account to mint to */
782
- destination: PublicKey;
783
- /** Amount of tokens to mint */
784
- amount: number | bigint;
785
- /** Mint authority (must be signer) */
786
- authority: PublicKey;
787
- /** Maximum lamports for rent and top-up combined. Transaction fails if exceeded. (0 = no limit) */
788
- maxTopUp?: number;
789
- /** Optional fee payer for rent top-ups. If not provided, authority pays. */
790
- feePayer?: PublicKey;
791
- }
792
- /**
793
- * Create instruction for minting tokens to a CToken account.
794
- *
795
- * This is a simple 3-4 account instruction for minting to decompressed CToken accounts.
796
- * Uses discriminator 7 (CTokenMintTo).
797
- *
798
- * @param params - Mint instruction parameters
799
- * @returns TransactionInstruction for minting tokens
800
- */
801
- declare function createMintToInstruction(params: CreateMintToInstructionParams): TransactionInstruction;
802
-
803
- /** Default compressible config PDA (V1) */
804
- declare const LIGHT_TOKEN_CONFIG: PublicKey;
805
- /** Default rent sponsor PDA (V1) */
806
- declare const LIGHT_TOKEN_RENT_SPONSOR: PublicKey;
807
- /**
808
- * Token data version enum - mirrors Rust TokenDataVersion
809
- * Used for compressed token account hashing strategy
810
- */
811
- declare enum TokenDataVersion {
812
- /** V1: Poseidon hash with little-endian amount, discriminator [2,0,0,0,0,0,0,0] */
813
- V1 = 1,
814
- /** V2: Poseidon hash with big-endian amount, discriminator [0,0,0,0,0,0,0,3] */
815
- V2 = 2,
816
- /** ShaFlat: SHA256 hash of borsh-serialized data, discriminator [0,0,0,0,0,0,0,4] */
817
- ShaFlat = 3
818
- }
819
- declare const POOL_SEED: Buffer$1<ArrayBuffer>;
820
- declare const CPI_AUTHORITY_SEED: Buffer$1<ArrayBuffer>;
821
- declare const SPL_TOKEN_MINT_RENT_EXEMPT_BALANCE = 1461600;
822
- declare const CREATE_TOKEN_POOL_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
823
- declare const MINT_TO_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
824
- declare const BATCH_COMPRESS_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
825
- declare const TRANSFER_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
826
- declare const COMPRESS_SPL_TOKEN_ACCOUNT_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
827
- declare const APPROVE_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
828
- declare const REVOKE_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
829
- declare const ADD_TOKEN_POOL_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
830
- declare const DECOMPRESS_ACCOUNTS_IDEMPOTENT_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
831
- /**
832
- * Rent configuration constants for compressible ctoken accounts.
833
- * These match the Rust SDK defaults in program-libs/compressible/src/rent/config.rs
834
- */
835
- /** Base rent per epoch (lamports) */
836
- declare const BASE_RENT_PER_EPOCH = 128;
837
- /** Rent per byte per epoch (lamports) */
838
- declare const RENT_PER_BYTE_PER_EPOCH = 1;
839
- /** Slots per rent epoch (1.5 hours) */
840
- declare const SLOTS_PER_RENT_EPOCH = 13500;
841
- /** Compression cost (lamports) - paid at account creation */
842
- declare const COMPRESSION_COST = 10000;
843
- /** Compression incentive (lamports) - paid at account creation */
844
- declare const COMPRESSION_INCENTIVE = 1000;
845
- /** Total compression cost (COMPRESSION_COST + COMPRESSION_INCENTIVE) */
846
- declare const TOTAL_COMPRESSION_COST: number;
847
- /**
848
- * Compressible ctoken account size in bytes.
849
- * = 165 (base SPL token) + 1 (account_type) + 1 (Option) + 4 (Vec len) + 1 (ext disc) + 4 (ext header) + 96 (CompressionInfo) = 272
850
- * Source: program-libs/token-interface/src/state/token/top_up.rs MIN_SIZE_WITH_COMPRESSIBLE
851
- */
852
- declare const COMPRESSIBLE_CTOKEN_ACCOUNT_SIZE = 272;
853
- /**
854
- * Calculate rent per epoch for a given account size.
855
- * Formula: base_rent + (bytes * lamports_per_byte_per_epoch)
856
- */
857
- declare function rentPerEpoch(bytes: number): number;
858
- /**
859
- * Default rent per epoch for a compressible ctoken account (272 bytes).
860
- * = 128 + 272 = 400 lamports
861
- */
862
- declare const COMPRESSIBLE_CTOKEN_RENT_PER_EPOCH: number;
863
- /** Default prepaid epochs (24 hours = 16 epochs * 1.5h) */
864
- declare const DEFAULT_PREPAY_EPOCHS = 16;
865
- /** Default write top-up (lamports) - ~2 epochs rent */
866
- declare const DEFAULT_WRITE_TOP_UP = 766;
867
- /**
868
- * Calculate fee payer cost at ATA creation.
869
- * = compression_cost (11K) + (prepay_epochs * rent_per_epoch)
870
- */
871
- declare function calculateFeePayerCostAtCreation(prepayEpochs?: number, accountBytes?: number): number;
872
-
873
- /**
874
- * Create instruction for minting tokens from a c-mint to compressed accounts.
875
- * To mint to onchain token accounts across SPL/T22/c-mints, use
876
- * {@link createMintToInterfaceInstruction} instead.
877
- *
878
- * @param authority Mint authority public key.
879
- * @param payer Fee payer public key.
880
- * @param validityProof Validity proof for the compressed mint.
881
- * @param merkleContext Merkle context of the compressed mint.
882
- * @param mintData Mint instruction data.
883
- * @param recipients Array of recipients with amounts.
884
- * @param outputStateTreeInfo Optional output state tree info. Uses merkle
885
- * context queue if not provided.
886
- * @param tokenAccountVersion Token account version (default:
887
- * TokenDataVersion.ShaFlat).
888
- */
889
- declare function createMintToCompressedInstruction(authority: PublicKey, payer: PublicKey, validityProof: ValidityProofWithContext, merkleContext: MerkleContext, mintData: MintInstructionData, recipients: Array<{
890
- recipient: PublicKey;
891
- amount: number | bigint;
892
- }>, outputStateTreeInfo?: TreeInfo, tokenAccountVersion?: TokenDataVersion): TransactionInstruction;
893
-
894
- /**
895
- * Create mint-to instruction for SPL, Token-2022, or CToken mints.
896
- * This instruction ONLY mints to decompressed/onchain token accounts.
897
- *
898
- * For CToken mints, the mint must be decompressed first (CMint account must exist on-chain).
899
- *
900
- * @param mintInterface Mint interface (SPL, Token-2022, or CToken).
901
- * @param destination Destination onchain token account address.
902
- * @param authority Mint authority public key.
903
- * @param payer Fee payer public key.
904
- * @param amount Amount to mint.
905
- * @param validityProof Not used (legacy parameter, kept for compatibility).
906
- * @param multiSigners Multi-signature signer public keys (SPL/T22 only).
907
- */
908
- declare function createMintToInterfaceInstruction(mintInterface: MintInterface, destination: PublicKey, authority: PublicKey, payer: PublicKey, amount: number | bigint, validityProof?: ValidityProofWithContext, multiSigners?: PublicKey[]): TransactionInstruction;
909
-
910
- /**
911
- * Create a Light token transfer instruction.
912
- *
913
- * For c-token accounts with compressible extension, the program needs
914
- * system_program and fee_payer to handle rent top-ups.
915
- *
916
- * @param source Source c-token account
917
- * @param destination Destination c-token account
918
- * @param owner Owner of the source account (signer, also pays for compressible extension top-ups)
919
- * @param amount Amount to transfer
920
- * @param feePayer Optional fee payer for top-ups (defaults to owner)
921
- * @returns Transaction instruction for Light token transfer
922
- */
923
- declare function createLightTokenTransferInstruction(source: PublicKey, destination: PublicKey, owner: PublicKey, amount: number | bigint, feePayer?: PublicKey): TransactionInstruction;
924
-
925
781
  declare namespace BN {
926
782
  type Endianness = "le" | "be";
927
783
  type IPrimeName = "k256" | "p224" | "p192" | "p25519";
@@ -1515,6 +1371,77 @@ declare class RedBN extends BN {
1515
1371
  redPow(b: BN): RedBN;
1516
1372
  }
1517
1373
 
1374
+ declare const TokenAccountSourceType: {
1375
+ readonly Spl: "spl";
1376
+ readonly Token2022: "token2022";
1377
+ readonly SplCold: "spl-cold";
1378
+ readonly Token2022Cold: "token2022-cold";
1379
+ readonly LightTokenHot: "light-token-hot";
1380
+ readonly LightTokenCold: "light-token-cold";
1381
+ };
1382
+ type TokenAccountSourceTypeValue = (typeof TokenAccountSourceType)[keyof typeof TokenAccountSourceType];
1383
+ /** @internal */
1384
+ interface TokenAccountSource {
1385
+ type: TokenAccountSourceTypeValue;
1386
+ address: PublicKey;
1387
+ amount: bigint;
1388
+ accountInfo: AccountInfo<Buffer$1>;
1389
+ loadContext?: MerkleContext;
1390
+ parsed: Account;
1391
+ }
1392
+ interface AccountInterface {
1393
+ accountInfo: AccountInfo<Buffer$1>;
1394
+ parsed: Account;
1395
+ isCold: boolean;
1396
+ loadContext?: MerkleContext;
1397
+ _sources?: TokenAccountSource[];
1398
+ _needsConsolidation?: boolean;
1399
+ _hasDelegate?: boolean;
1400
+ _anyFrozen?: boolean;
1401
+ /** True when fetched via getAtaInterface */
1402
+ _isAta?: boolean;
1403
+ /** Associated token account owner - set by getAtaInterface */
1404
+ _owner?: PublicKey;
1405
+ /** Associated token account mint - set by getAtaInterface */
1406
+ _mint?: PublicKey;
1407
+ }
1408
+ /** @internal */
1409
+ declare function convertTokenDataToAccount(address: PublicKey, tokenData: {
1410
+ mint: PublicKey;
1411
+ owner: PublicKey;
1412
+ amount: BN;
1413
+ delegate: PublicKey | null;
1414
+ state: number;
1415
+ tlv: Buffer$1 | null;
1416
+ }): Account;
1417
+ /** Convert compressed account to AccountInfo */
1418
+ declare function toAccountInfo(compressedAccount: CompressedAccountWithMerkleContext): AccountInfo<Buffer$1>;
1419
+ /** @internal */
1420
+ declare function parseLightTokenHot(address: PublicKey, accountInfo: AccountInfo<Buffer$1>): {
1421
+ accountInfo: AccountInfo<Buffer$1>;
1422
+ loadContext: undefined;
1423
+ parsed: Account;
1424
+ isCold: false;
1425
+ };
1426
+ /** @internal */
1427
+ declare function parseLightTokenCold(address: PublicKey, compressedAccount: CompressedAccountWithMerkleContext): {
1428
+ accountInfo: AccountInfo<Buffer$1>;
1429
+ loadContext: MerkleContext;
1430
+ parsed: Account;
1431
+ isCold: true;
1432
+ };
1433
+ /**
1434
+ * Retrieve information about a token account of SPL/T22/light-token.
1435
+ *
1436
+ * @param rpc RPC connection to use
1437
+ * @param address Token account address
1438
+ * @param commitment Desired level of commitment for querying the state
1439
+ * @param programId Token program ID. If not provided, tries all programs concurrently.
1440
+ *
1441
+ * @return Token account information with compression context if applicable
1442
+ */
1443
+ declare function getAccountInterface(rpc: Rpc, address: PublicKey, commitment?: Commitment, programId?: PublicKey): Promise<AccountInterface>;
1444
+
1518
1445
  /**
1519
1446
  * SPL interface PDA info.
1520
1447
  */
@@ -1699,341 +1626,210 @@ declare function selectTokenPoolInfo(infos: TokenPoolInfo[]): TokenPoolInfo;
1699
1626
  */
1700
1627
  declare function selectTokenPoolInfosForDecompression(infos: TokenPoolInfo[], decompressAmount: number | BN): TokenPoolInfo[];
1701
1628
 
1702
- /**
1703
- * Create decompressInterface instruction using Transfer2.
1704
- *
1705
- * Supports decompressing to both c-token accounts and SPL token accounts:
1706
- * - For c-token destinations: No splInterfaceInfo needed
1707
- * - For SPL destinations: Provide splInterfaceInfo (token pool info) and decimals
1708
- *
1709
- * @param payer Fee payer public key
1710
- * @param inputCompressedTokenAccounts Input compressed token accounts
1711
- * @param toAddress Destination token account address (c-token or SPL ATA)
1712
- * @param amount Amount to decompress
1713
- * @param validityProof Validity proof (contains compressedProof and rootIndices)
1714
- * @param splInterfaceInfo Optional: SPL interface info for SPL destinations
1715
- * @param decimals Mint decimals (required for SPL destinations)
1716
- * @returns TransactionInstruction
1717
- */
1718
- declare function createDecompressInterfaceInstruction(payer: PublicKey, inputCompressedTokenAccounts: ParsedTokenAccount[], toAddress: PublicKey, amount: bigint, validityProof: ValidityProofWithContext, splInterfaceInfo: SplInterfaceInfo | undefined, decimals: number): TransactionInstruction;
1719
-
1720
- declare const TokenAccountSourceType: {
1721
- readonly Spl: "spl";
1722
- readonly Token2022: "token2022";
1723
- readonly SplCold: "spl-cold";
1724
- readonly Token2022Cold: "token2022-cold";
1725
- readonly CTokenHot: "ctoken-hot";
1726
- readonly CTokenCold: "ctoken-cold";
1727
- };
1728
- type TokenAccountSourceTypeValue = (typeof TokenAccountSourceType)[keyof typeof TokenAccountSourceType];
1729
- /** @internal */
1730
- interface TokenAccountSource {
1731
- type: TokenAccountSourceTypeValue;
1732
- address: PublicKey;
1733
- amount: bigint;
1734
- accountInfo: AccountInfo<Buffer$1>;
1735
- loadContext?: MerkleContext;
1736
- parsed: Account;
1737
- }
1738
- interface AccountInterface {
1739
- accountInfo: AccountInfo<Buffer$1>;
1740
- parsed: Account;
1741
- isCold: boolean;
1742
- loadContext?: MerkleContext;
1743
- _sources?: TokenAccountSource[];
1744
- _needsConsolidation?: boolean;
1745
- _hasDelegate?: boolean;
1746
- _anyFrozen?: boolean;
1747
- /** True when fetched via getAtaInterface */
1748
- _isAta?: boolean;
1749
- /** ATA owner - set by getAtaInterface */
1750
- _owner?: PublicKey;
1751
- /** ATA mint - set by getAtaInterface */
1752
- _mint?: PublicKey;
1753
- }
1754
- /** @internal */
1755
- declare function convertTokenDataToAccount(address: PublicKey, tokenData: {
1756
- mint: PublicKey;
1757
- owner: PublicKey;
1758
- amount: BN;
1759
- delegate: PublicKey | null;
1760
- state: number;
1761
- tlv: Buffer$1 | null;
1762
- }): Account;
1763
- /** Convert compressed account to AccountInfo */
1764
- declare function toAccountInfo(compressedAccount: CompressedAccountWithMerkleContext): AccountInfo<Buffer$1>;
1765
- /** @internal */
1766
- declare function parseCTokenHot(address: PublicKey, accountInfo: AccountInfo<Buffer$1>): {
1767
- accountInfo: AccountInfo<Buffer$1>;
1768
- loadContext: undefined;
1769
- parsed: Account;
1770
- isCold: false;
1771
- };
1772
- /** @internal */
1773
- declare function parseCTokenCold(address: PublicKey, compressedAccount: CompressedAccountWithMerkleContext): {
1774
- accountInfo: AccountInfo<Buffer$1>;
1775
- loadContext: MerkleContext;
1776
- parsed: Account;
1777
- isCold: true;
1629
+ declare function sliceLast<T>(items: T[]): {
1630
+ rest: T[];
1631
+ last: T;
1778
1632
  };
1633
+
1779
1634
  /**
1780
- * Retrieve information about a token account of SPL/T22/c-token.
1635
+ * Create a light-token transfer instruction.
1781
1636
  *
1782
- * @param rpc RPC connection to use
1783
- * @param address Token account address
1784
- * @param commitment Desired level of commitment for querying the state
1785
- * @param programId Token program ID. If not provided, tries all programs concurrently.
1637
+ * For light-token accounts with compressible extension, the program needs
1638
+ * system_program and fee_payer to handle rent top-ups.
1786
1639
  *
1787
- * @return Token account information with compression context if applicable
1640
+ * @param source Source light-token account
1641
+ * @param destination Destination light-token account
1642
+ * @param owner Owner of the source account (signer, also pays for compressible extension top-ups)
1643
+ * @param amount Amount to transfer
1644
+ * @param feePayer Optional fee payer for top-ups (defaults to owner)
1645
+ * @returns Transaction instruction for light-token transfer
1788
1646
  */
1789
- declare function getAccountInterface(rpc: Rpc, address: PublicKey, commitment?: Commitment, programId?: PublicKey): Promise<AccountInterface>;
1790
-
1647
+ declare function createLightTokenTransferInstruction(source: PublicKey, destination: PublicKey, owner: PublicKey, amount: number | bigint, feePayer?: PublicKey): TransactionInstruction;
1791
1648
  /**
1792
- * Options for interface operations (load, transfer)
1649
+ * Create a light-token transfer_checked instruction. Same semantics as SPL
1650
+ * TransferChecked.
1793
1651
  */
1652
+ declare function createLightTokenTransferCheckedInstruction(source: PublicKey, destination: PublicKey, mint: PublicKey, owner: PublicKey, amount: number | bigint, decimals: number, payer: PublicKey): TransactionInstruction;
1653
+ declare function createTransferToAccountInterfaceInstructions(rpc: Rpc, payer: PublicKey, mint: PublicKey, amount: number | bigint | BN, owner: PublicKey, destination: PublicKey, decimals: number, options?: InterfaceOptions, programId?: PublicKey): Promise<TransactionInstruction[][]>;
1654
+
1794
1655
  interface InterfaceOptions {
1795
- /** SPL interface infos (fetched if not provided) */
1796
1656
  splInterfaceInfos?: SplInterfaceInfo[];
1797
- }
1798
- /**
1799
- * Transfer tokens using the c-token interface.
1800
- *
1801
- * High-level action: resolves balances, builds all instructions (load +
1802
- * transfer), signs, and sends. Creates the recipient ATA if it does not exist.
1803
- *
1804
- * For instruction-level control, use `createTransferInterfaceInstructions`.
1805
- *
1806
- * @param rpc RPC connection
1807
- * @param payer Fee payer (signer)
1808
- * @param source Source c-token ATA address
1809
- * @param mint Mint address
1810
- * @param destination Recipient wallet public key
1811
- * @param owner Source owner (signer)
1812
- * @param amount Amount to transfer
1813
- * @param programId Token program ID (default: LIGHT_TOKEN_PROGRAM_ID)
1814
- * @param confirmOptions Optional confirm options
1815
- * @param options Optional interface options
1816
- * @param wrap Include SPL/T22 wrapping (default: false)
1817
- * @returns Transaction signature of the transfer transaction
1818
- */
1819
- 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): Promise<TransactionSignature>;
1820
- /**
1821
- * Options for createTransferInterfaceInstructions.
1822
- */
1823
- interface TransferOptions extends InterfaceOptions {
1824
- /** Include SPL/T22 wrapping to c-token ATA (unified path). Default: false. */
1825
1657
  wrap?: boolean;
1826
- /** Token program ID. Default: LIGHT_TOKEN_PROGRAM_ID. */
1827
- programId?: PublicKey;
1828
1658
  /**
1829
- * Include an idempotent recipient ATA creation instruction in the
1830
- * transfer transaction. No extra RPC fetch -- uses
1831
- * createAssociatedTokenAccountInterfaceIdempotentInstruction which is
1832
- * a no-op on-chain if the ATA already exists (~200 CU overhead).
1833
- * Default: true.
1659
+ * Delegate authority pubkey. For owner-signed flows, omit this field.
1834
1660
  */
1835
- ensureRecipientAta?: boolean;
1661
+ delegatePubkey?: PublicKey;
1836
1662
  }
1663
+ declare function transferToAccountInterface(rpc: Rpc, payer: Signer, source: PublicKey, mint: PublicKey, destination: PublicKey, owner: PublicKey, authority: Signer, amount: number | bigint | BN, programId?: PublicKey, confirmOptions?: ConfirmOptions, options?: InterfaceOptions, decimals?: number): Promise<TransactionSignature>;
1664
+ declare function transferInterface(rpc: Rpc, payer: Signer, source: PublicKey, mint: PublicKey, recipient: PublicKey, owner: PublicKey, authority: Signer, amount: number | bigint | BN, programId?: PublicKey, confirmOptions?: ConfirmOptions, options?: InterfaceOptions, decimals?: number): Promise<TransactionSignature>;
1665
+
1666
+ declare function createTransferInterfaceInstructions(rpc: Rpc, payer: PublicKey, mint: PublicKey, amount: number | bigint | BN, owner: PublicKey, recipient: PublicKey, decimals: number, options?: InterfaceOptions, programId?: PublicKey): Promise<TransactionInstruction[][]>;
1667
+
1668
+ declare function selectInputsForAmount(accounts: ParsedTokenAccount[], neededAmount: bigint): ParsedTokenAccount[];
1669
+
1837
1670
  /**
1838
- * Splits the last element from an array.
1839
- *
1840
- * Useful for separating load transactions (parallel) from the final transfer
1841
- * transaction (sequential) returned by `createTransferInterfaceInstructions`.
1842
- *
1843
- * @returns `{ rest, last }` where `rest` is everything before the last
1844
- * element and `last` is the last element.
1845
- * @throws if the input array is empty.
1671
+ * Parameters for creating a MintTo instruction.
1846
1672
  */
1847
- declare function sliceLast<T>(items: T[]): {
1848
- rest: T[];
1849
- last: T;
1850
- };
1673
+ interface CreateMintToInstructionParams {
1674
+ /** Light mint account (decompressed from compressed light mint) */
1675
+ mint: PublicKey;
1676
+ /** Destination light-token account to mint to */
1677
+ destination: PublicKey;
1678
+ /** Amount of tokens to mint */
1679
+ amount: number | bigint;
1680
+ /** Mint authority (must be signer) */
1681
+ authority: PublicKey;
1682
+ /** Maximum lamports for rent and top-up combined. Transaction fails if exceeded. (u16::MAX = no limit, 0 = no top-ups allowed) */
1683
+ maxTopUp?: number;
1684
+ /** Optional fee payer for rent top-ups. If not provided, authority pays. */
1685
+ feePayer?: PublicKey;
1686
+ }
1851
1687
  /**
1852
- * Create instructions for a c-token transfer.
1853
- *
1854
- * Returns `TransactionInstruction[][]` -- an array of transaction instruction
1855
- * arrays. Each inner array is one transaction to sign and send.
1856
- *
1857
- * - All transactions except the last can be sent in parallel (load/decompress).
1858
- * - The last transaction is the transfer and must be sent after all others
1859
- * confirm.
1860
- * - For a hot sender or <=8 cold inputs, the result is a single-element array.
1688
+ * Create instruction for minting tokens to a light-token account.
1861
1689
  *
1862
- * Use `sliceLast` to separate the parallel prefix from the final transfer:
1863
- * ```
1864
- * const batches = await createTransferInterfaceInstructions(...);
1865
- * const { rest, last } = sliceLast(batches);
1866
- * ```
1690
+ * This is a simple 3-4 account instruction for minting to light-token associated token accounts (hot).
1691
+ * Uses discriminator 7 (LightTokenMintTo).
1867
1692
  *
1868
- * When `ensureRecipientAta` is true (the default), an idempotent ATA creation
1869
- * instruction is included in the transfer (last) transaction. No extra RPC
1870
- * fetch -- the instruction is a no-op on-chain if the ATA already exists.
1871
- * Set `ensureRecipientAta: false` if you manage recipient ATAs yourself.
1872
- *
1873
- * All transactions require payer + sender as signers.
1874
- *
1875
- * Hash uniqueness guarantee: all compressed accounts for the sender are
1876
- * fetched once, then partitioned into non-overlapping chunks by tree version.
1877
- * Each hash appears in exactly one batch. This is enforced at runtime by
1878
- * `assertUniqueInputHashes` inside `_buildLoadBatches`.
1879
- *
1880
- * @param rpc RPC connection
1881
- * @param payer Fee payer public key
1882
- * @param mint Mint address
1883
- * @param amount Amount to transfer
1884
- * @param sender Sender public key (must sign all transactions)
1885
- * @param recipient Recipient public key
1886
- * @param options Optional configuration
1887
- * @returns TransactionInstruction[][] -- send [0..n-2] in parallel, then [n-1]
1693
+ * @param params - Mint instruction parameters
1694
+ * @returns TransactionInstruction for minting tokens
1888
1695
  */
1889
- declare function createTransferInterfaceInstructions(rpc: Rpc, payer: PublicKey, mint: PublicKey, amount: number | bigint | BN, sender: PublicKey, recipient: PublicKey, options?: TransferOptions): Promise<TransactionInstruction[][]>;
1696
+ declare function createMintToInstruction(params: CreateMintToInstructionParams): TransactionInstruction;
1890
1697
 
1698
+ /** Default compressible config PDA (V1) */
1699
+ declare const LIGHT_TOKEN_CONFIG: PublicKey;
1700
+ /** Default rent sponsor PDA (V1) */
1701
+ declare const LIGHT_TOKEN_RENT_SPONSOR: PublicKey;
1891
1702
  /**
1892
- * Account info interface for compressible accounts.
1893
- * Matches return structure of getAccountInterface/getAtaInterface.
1894
- *
1895
- * Integrating programs provide their own fetch/parse - this is just the data shape.
1703
+ * Token data version enum - mirrors Rust TokenDataVersion
1704
+ * Used for compressed token account hashing strategy
1896
1705
  */
1897
- interface ParsedAccountInfoInterface<T = unknown> {
1898
- /** Parsed account data (program-specific) */
1899
- parsed: T;
1900
- /** Load context - present if account is compressed (cold), undefined if hot */
1901
- loadContext?: MerkleContext;
1706
+ declare enum TokenDataVersion {
1707
+ /** V1: Poseidon hash with little-endian amount, discriminator [2,0,0,0,0,0,0,0] */
1708
+ V1 = 1,
1709
+ /** V2: Poseidon hash with big-endian amount, discriminator [0,0,0,0,0,0,0,3] */
1710
+ V2 = 2,
1711
+ /** ShaFlat: SHA256 hash of borsh-serialized data, discriminator [0,0,0,0,0,0,0,4] */
1712
+ ShaFlat = 3
1902
1713
  }
1714
+ declare const POOL_SEED: Buffer$1<ArrayBuffer>;
1715
+ declare const CPI_AUTHORITY_SEED: Buffer$1<ArrayBuffer>;
1716
+ declare const SPL_TOKEN_MINT_RENT_EXEMPT_BALANCE = 1461600;
1717
+ declare const CREATE_TOKEN_POOL_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
1718
+ declare const MINT_TO_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
1719
+ declare const BATCH_COMPRESS_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
1720
+ declare const TRANSFER_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
1721
+ declare const COMPRESS_SPL_TOKEN_ACCOUNT_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
1722
+ declare const APPROVE_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
1723
+ declare const REVOKE_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
1724
+ declare const ADD_TOKEN_POOL_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
1903
1725
  /**
1904
- * Input for createLoadAccountsParams.
1905
- * Supports both program PDAs and c-token vaults.
1906
- *
1907
- * The integrating program is responsible for fetching and parsing their accounts.
1908
- * This helper just packs them for the decompressAccountsIdempotent instruction.
1726
+ * Maximum lamports for rent top-up in a single instruction.
1727
+ * u16::MAX = no limit; 0 = no top-ups allowed.
1728
+ * Matches Rust SDK (e.g. token-sdk create_mints uses u16::MAX for "no limit").
1909
1729
  */
1910
- interface CompressibleAccountInput<T = unknown> {
1911
- /** Account address */
1912
- address: PublicKey;
1913
- /**
1914
- * Account type key for packing:
1915
- * - For PDAs: program-specific type name (e.g., "poolState", "observationState")
1916
- * - For c-token vaults: "cTokenData"
1917
- */
1918
- accountType: string;
1919
- /**
1920
- * Token variant - required when accountType is "cTokenData".
1921
- * Examples: "lpVault", "token0Vault", "token1Vault"
1922
- */
1923
- tokenVariant?: string;
1924
- /** Parsed account info (from program-specific fetch) */
1925
- info: ParsedAccountInfoInterface<T>;
1926
- }
1730
+ declare const MAX_TOP_UP = 65535;
1927
1731
  /**
1928
- * Packed compressed account for decompressAccountsIdempotent instruction
1732
+ * Rent configuration constants for compressible light token accounts.
1733
+ * These match the Rust SDK defaults in program-libs/compressible/src/rent/config.rs
1929
1734
  */
1930
- interface PackedCompressedAccount {
1931
- [key: string]: unknown;
1932
- merkleContext: {
1933
- merkleTreePubkeyIndex: number;
1934
- queuePubkeyIndex: number;
1935
- };
1936
- }
1735
+ /** Base rent per epoch (lamports) */
1736
+ declare const BASE_RENT_PER_EPOCH = 128;
1737
+ /** Rent per byte per epoch (lamports) */
1738
+ declare const RENT_PER_BYTE_PER_EPOCH = 1;
1739
+ /** Slots per rent epoch (1.5 hours) */
1740
+ declare const SLOTS_PER_RENT_EPOCH = 13500;
1741
+ /** Compression cost (lamports) - paid at account creation */
1742
+ declare const COMPRESSION_COST = 10000;
1743
+ /** Compression incentive (lamports) - paid at account creation */
1744
+ declare const COMPRESSION_INCENTIVE = 1000;
1745
+ /** Total compression cost (COMPRESSION_COST + COMPRESSION_INCENTIVE) */
1746
+ declare const TOTAL_COMPRESSION_COST: number;
1937
1747
  /**
1938
- * Result from building load params
1748
+ * Compressible light token account size in bytes.
1749
+ * = 165 (base SPL token) + 1 (account_type) + 1 (Option) + 4 (Vec len) + 1 (ext disc) + 4 (ext header) + 96 (CompressionInfo) = 272
1750
+ * Source: program-libs/token-interface/src/state/token/top_up.rs MIN_SIZE_WITH_COMPRESSIBLE
1939
1751
  */
1940
- interface CompressibleLoadParams {
1941
- /** Validity proof wrapped in option (null if all proveByIndex) */
1942
- proofOption: {
1943
- 0: ValidityProof | null;
1944
- };
1945
- /** Packed compressed accounts data for instruction */
1946
- compressedAccounts: PackedCompressedAccount[];
1947
- /** Offset to system accounts in remainingAccounts */
1948
- systemAccountsOffset: number;
1949
- /** Account metas for remaining accounts */
1950
- remainingAccounts: AccountMeta[];
1951
- }
1752
+ declare const COMPRESSIBLE_LIGHT_TOKEN_ACCOUNT_SIZE = 272;
1952
1753
  /**
1953
- * Result from createLoadAccountsParams
1754
+ * Calculate rent per epoch for a given account size.
1755
+ * Formula: base_rent + (bytes * lamports_per_byte_per_epoch)
1954
1756
  */
1955
- interface LoadResult {
1956
- /** Params for decompressAccountsIdempotent (null if no program accounts need decompressing) */
1957
- decompressParams: CompressibleLoadParams | null;
1958
- /** Instructions to load ATAs (create ATA, wrap SPL/T22, decompressInterface) */
1959
- ataInstructions: TransactionInstruction[];
1960
- }
1757
+ declare function rentPerEpoch(bytes: number): number;
1961
1758
  /**
1962
- * Create params for loading program accounts and ATAs.
1963
- *
1964
- * Returns:
1965
- * - decompressParams: for a caller program's standardized
1966
- * decompressAccountsIdempotent instruction
1967
- * - ataInstructions: for loading user ATAs
1968
- *
1969
- * @param rpc RPC connection
1970
- * @param payer Fee payer (needed for ATA instructions)
1971
- * @param programId Program ID for decompressAccountsIdempotent
1972
- * @param programAccounts PDAs and vaults (caller pre-fetches)
1973
- * @param atas User ATAs (fetched via getAtaInterface)
1974
- * @param options Optional load options
1975
- * @returns LoadResult with decompressParams and ataInstructions
1976
- *
1977
- * @example
1978
- * ```typescript
1979
- * const poolInfo = await myProgram.fetchPoolState(rpc, poolAddress);
1980
- * const vault0Ata = getAssociatedTokenAddressInterface(token0Mint, poolAddress);
1981
- * const vault0Info = await getAtaInterface(rpc, vault0Ata, poolAddress, token0Mint, undefined, LIGHT_TOKEN_PROGRAM_ID);
1982
- * const userAta = getAssociatedTokenAddressInterface(tokenMint, userWallet);
1983
- * const userAtaInfo = await getAtaInterface(rpc, userAta, userWallet, tokenMint);
1984
- *
1985
- * const result = await createLoadAccountsParams(
1986
- * rpc,
1987
- * payer.publicKey,
1988
- * programId,
1989
- * [
1990
- * { address: poolAddress, accountType: 'poolState', info: poolInfo },
1991
- * { address: vault0, accountType: 'cTokenData', tokenVariant: 'token0Vault', info: vault0Info },
1992
- * ],
1993
- * [userAta],
1994
- * );
1759
+ * Default rent per epoch for a compressible light token account (272 bytes).
1760
+ * = 128 + 272 = 400 lamports
1761
+ */
1762
+ declare const COMPRESSIBLE_LIGHT_TOKEN_RENT_PER_EPOCH: number;
1763
+ /** Default prepaid epochs (24 hours = 16 epochs * 1.5h) */
1764
+ declare const DEFAULT_PREPAY_EPOCHS = 16;
1765
+ /** Default write top-up (lamports) - ~2 epochs rent */
1766
+ declare const DEFAULT_WRITE_TOP_UP = 766;
1767
+ /**
1768
+ * Calculate fee payer cost at ATA creation.
1769
+ * = compression_cost (11K) + (prepay_epochs * rent_per_epoch)
1770
+ */
1771
+ declare function calculateFeePayerCostAtCreation(prepayEpochs?: number, accountBytes?: number): number;
1772
+
1773
+ /**
1774
+ * Create instruction for minting tokens from a light mint to compressed accounts.
1775
+ * To mint to light-token associated token accounts across SPL/T22/light mints, use
1776
+ * {@link createMintToInterfaceInstruction} instead.
1995
1777
  *
1996
- * // Build transaction with both program decompress and ATA load
1997
- * const instructions = [...result.ataInstructions];
1998
- * if (result.decompressParams) {
1999
- * instructions.push(await program.methods
2000
- * .decompressAccountsIdempotent(
2001
- * result.decompressParams.proofOption,
2002
- * result.decompressParams.compressedAccounts,
2003
- * result.decompressParams.systemAccountsOffset,
2004
- * )
2005
- * .remainingAccounts(result.decompressParams.remainingAccounts)
2006
- * .instruction());
2007
- * }
2008
- * ```
1778
+ * @param authority Mint authority public key.
1779
+ * @param payer Fee payer public key.
1780
+ * @param validityProof Validity proof for the light mint.
1781
+ * @param merkleContext Merkle context of the light mint.
1782
+ * @param mintData Mint instruction data.
1783
+ * @param recipients Array of recipients with amounts.
1784
+ * @param outputStateTreeInfo Optional output state tree info. Uses merkle
1785
+ * context queue if not provided.
1786
+ * @param tokenAccountVersion Token account version (default:
1787
+ * TokenDataVersion.ShaFlat).
1788
+ * @param maxTopUp Optional cap on rent top-up (units of 1k lamports; default no cap)
2009
1789
  */
2010
- declare function createLoadAccountsParams(rpc: Rpc, payer: PublicKey, programId: PublicKey, programAccounts?: CompressibleAccountInput[], atas?: AccountInterface[], options?: InterfaceOptions): Promise<LoadResult>;
1790
+ declare function createMintToCompressedInstruction(authority: PublicKey, payer: PublicKey, validityProof: ValidityProofWithContext, merkleContext: MerkleContext, mintData: MintInstructionData, recipients: Array<{
1791
+ recipient: PublicKey;
1792
+ amount: number | bigint;
1793
+ }>, outputStateTreeInfo?: TreeInfo, tokenAccountVersion?: TokenDataVersion, maxTopUp?: number): TransactionInstruction;
1794
+
2011
1795
  /**
2012
- * Calculate compute units for compressible load operation
1796
+ * Create mint-to instruction for SPL, Token-2022, or light-token mints.
1797
+ * This instruction ONLY mints to light-token associated token accounts (hot).
1798
+ *
1799
+ * For light-token mints, the light mint account must exist (mint must be decompressed first).
1800
+ *
1801
+ * @param mintInterface Mint interface (SPL, Token-2022, or light-token).
1802
+ * @param destination Destination onchain token account address.
1803
+ * @param authority Mint authority public key.
1804
+ * @param payer Fee payer public key.
1805
+ * @param amount Amount to mint.
1806
+ * @param validityProof Not used (legacy parameter, kept for compatibility).
1807
+ * @param multiSigners Multi-signature signer public keys (SPL/T22 only).
2013
1808
  */
2014
- declare function calculateCompressibleLoadComputeUnits(compressedAccountCount: number, hasValidityProof: boolean): number;
1809
+ declare function createMintToInterfaceInstruction(mintInterface: MintInterface, destination: PublicKey, authority: PublicKey, payer: PublicKey, amount: number | bigint, validityProof?: ValidityProofWithContext, multiSigners?: PublicKey[]): TransactionInstruction;
2015
1810
 
2016
1811
  /**
2017
1812
  * Create a wrap instruction that moves tokens from an SPL/T22 account to a
2018
- * c-token account.
1813
+ * light-token account.
2019
1814
  *
2020
1815
  * @param source Source SPL/T22 token account
2021
- * @param destination Destination c-token account
1816
+ * @param destination Destination light-token account
2022
1817
  * @param owner Owner of the source account (signer)
2023
1818
  * @param mint Mint address
2024
1819
  * @param amount Amount to wrap,
2025
1820
  * @param splInterfaceInfo SPL interface info for the compression
2026
1821
  * @param decimals Mint decimals (required for transfer_checked)
2027
1822
  * @param payer Fee payer (defaults to owner)
1823
+ * @param maxTopUp Optional cap on rent top-up (units of 1k lamports; default no cap)
2028
1824
  * @returns Instruction to wrap tokens
2029
1825
  */
2030
- declare function createWrapInstruction(source: PublicKey, destination: PublicKey, owner: PublicKey, mint: PublicKey, amount: bigint, splInterfaceInfo: SplInterfaceInfo, decimals: number, payer?: PublicKey): TransactionInstruction;
1826
+ declare function createWrapInstruction(source: PublicKey, destination: PublicKey, owner: PublicKey, mint: PublicKey, amount: bigint, splInterfaceInfo: SplInterfaceInfo, decimals: number, payer?: PublicKey, maxTopUp?: number): TransactionInstruction;
2031
1827
 
2032
1828
  /**
2033
- * Create an unwrap instruction that moves tokens from a c-token account to an
1829
+ * Create an unwrap instruction that moves tokens from a light-token account to an
2034
1830
  * SPL/T22 account.
2035
1831
  *
2036
- * @param source Source c-token account
1832
+ * @param source Source light-token account
2037
1833
  * @param destination Destination SPL/T22 token account
2038
1834
  * @param owner Owner of the source account (signer)
2039
1835
  * @param mint Mint address
@@ -2041,24 +1837,143 @@ declare function createWrapInstruction(source: PublicKey, destination: PublicKey
2041
1837
  * @param splInterfaceInfo SPL interface info for the decompression
2042
1838
  * @param decimals Mint decimals (required for transfer_checked)
2043
1839
  * @param payer Fee payer (defaults to owner if not provided)
1840
+ * @param maxTopUp Optional cap on rent top-up (units of 1k lamports; default no cap)
2044
1841
  * @returns TransactionInstruction to unwrap tokens
2045
1842
  */
2046
- declare function createUnwrapInstruction(source: PublicKey, destination: PublicKey, owner: PublicKey, mint: PublicKey, amount: bigint, splInterfaceInfo: SplInterfaceInfo, decimals: number, payer?: PublicKey): TransactionInstruction;
1843
+ declare function createUnwrapInstruction(source: PublicKey, destination: PublicKey, owner: PublicKey, mint: PublicKey, amount: bigint, splInterfaceInfo: SplInterfaceInfo, decimals: number, payer?: PublicKey, maxTopUp?: number): TransactionInstruction;
1844
+ declare function createUnwrapInstructions(rpc: Rpc, destination: PublicKey, owner: PublicKey, mint: PublicKey, decimals: number, amount?: number | bigint | BN, payer?: PublicKey, splInterfaceInfo?: SplInterfaceInfo, maxTopUp?: number, interfaceOptions?: InterfaceOptions, wrap?: boolean): Promise<TransactionInstruction[][]>;
2047
1845
 
2048
1846
  /**
2049
- * Create and initialize a new mint for SPL/T22/c-token.
1847
+ * Create an instruction to freeze a decompressed light-token account.
1848
+ *
1849
+ * Freezing sets the account state to AccountState::Frozen, preventing
1850
+ * transfers and other token operations. Only the mint's freeze_authority
1851
+ * can freeze accounts.
1852
+ *
1853
+ * Account order per program:
1854
+ * 0. token_account (mutable) - the light-token account to freeze
1855
+ * 1. mint (readonly) - the mint associated with the token account
1856
+ * 2. freeze_authority - must match mint.freeze_authority (signer)
1857
+ *
1858
+ * @param tokenAccount The light-token account to freeze (must be Initialized)
1859
+ * @param mint The mint of the light-token account
1860
+ * @param freezeAuthority The freeze authority of the mint (signer)
1861
+ * @returns TransactionInstruction
1862
+ */
1863
+ declare function createLightTokenFreezeAccountInstruction(tokenAccount: PublicKey, mint: PublicKey, freezeAuthority: PublicKey): TransactionInstruction;
1864
+ /**
1865
+ * Create an instruction to thaw (unfreeze) a frozen light-token account.
1866
+ *
1867
+ * Thawing restores the account state from AccountState::Frozen to
1868
+ * AccountState::Initialized, re-enabling token operations. Only the
1869
+ * mint's freeze_authority can thaw accounts.
1870
+ *
1871
+ * Account order per program:
1872
+ * 0. token_account (mutable) - the frozen light-token account to thaw
1873
+ * 1. mint (readonly) - the mint associated with the token account
1874
+ * 2. freeze_authority - must match mint.freeze_authority (signer)
1875
+ *
1876
+ * @param tokenAccount The frozen light-token account to thaw
1877
+ * @param mint The mint of the light-token account
1878
+ * @param freezeAuthority The freeze authority of the mint (signer)
1879
+ * @returns TransactionInstruction
1880
+ */
1881
+ declare function createLightTokenThawAccountInstruction(tokenAccount: PublicKey, mint: PublicKey, freezeAuthority: PublicKey): TransactionInstruction;
1882
+
1883
+ /**
1884
+ * Create an instruction to approve a delegate for a light-token account.
1885
+ *
1886
+ * Account order per program:
1887
+ * 0. token_account (mutable) - the light-token account
1888
+ * 1. delegate (readonly) - the delegate to approve
1889
+ * 2. owner (signer) - owner of the token account
1890
+ * 3. system_program (readonly) - for rent top-ups via CPI
1891
+ * 4. fee_payer (mutable, signer) - pays for rent top-ups
1892
+ *
1893
+ * @param tokenAccount The light-token account to set delegation on
1894
+ * @param delegate The delegate to approve
1895
+ * @param owner Owner of the token account (signer)
1896
+ * @param amount Amount of tokens to delegate
1897
+ * @param feePayer Optional fee payer for rent top-ups (defaults to owner)
1898
+ * @returns TransactionInstruction
1899
+ */
1900
+ declare function createLightTokenApproveInstruction(tokenAccount: PublicKey, delegate: PublicKey, owner: PublicKey, amount: number | bigint, feePayer?: PublicKey): TransactionInstruction;
1901
+ /**
1902
+ * Create an instruction to revoke delegation for a light-token account.
1903
+ *
1904
+ * Account order per program:
1905
+ * 0. token_account (mutable) - the light-token account
1906
+ * 1. owner (signer) - owner of the token account
1907
+ * 2. system_program (readonly) - for rent top-ups via CPI
1908
+ * 3. fee_payer (mutable, signer) - pays for rent top-ups
1909
+ *
1910
+ * @param tokenAccount The light-token account to revoke delegation on
1911
+ * @param owner Owner of the token account (signer)
1912
+ * @param feePayer Optional fee payer for rent top-ups (defaults to owner)
1913
+ * @returns TransactionInstruction
1914
+ */
1915
+ declare function createLightTokenRevokeInstruction(tokenAccount: PublicKey, owner: PublicKey, feePayer?: PublicKey): TransactionInstruction;
1916
+
1917
+ /**
1918
+ * Build instruction batches for approving a delegate on an ATA.
1919
+ *
1920
+ * Supports light-token, SPL, and Token-2022 mints.
1921
+ * Returns `TransactionInstruction[][]`. Send [0..n-2] in parallel, then [n-1].
1922
+ *
1923
+ * @remarks For light-token mints, all cold (compressed) balances are loaded
1924
+ * into the hot ATA before the approve instruction. The `amount` parameter
1925
+ * only controls the delegate's spending limit, not the number of accounts
1926
+ * loaded. Users with many cold accounts may see additional load transactions.
1927
+ *
1928
+ * @param rpc RPC connection
1929
+ * @param payer Fee payer public key
1930
+ * @param mint Mint address
1931
+ * @param tokenAccount ATA address
1932
+ * @param delegate Delegate to approve
1933
+ * @param amount Amount to delegate
1934
+ * @param owner Owner public key
1935
+ * @param decimals Token decimals
1936
+ * @param programId Token program ID (default: LIGHT_TOKEN_PROGRAM_ID)
1937
+ * @param options Optional interface options (`wrap` is nested here)
1938
+ * @returns Instruction batches
1939
+ */
1940
+ declare function createApproveInterfaceInstructions(rpc: Rpc, payer: PublicKey, mint: PublicKey, tokenAccount: PublicKey, delegate: PublicKey, amount: number | bigint | BN, owner: PublicKey, decimals: number, programId?: PublicKey, options?: InterfaceOptions): Promise<TransactionInstruction[][]>;
1941
+ /**
1942
+ * Build instruction batches for revoking delegation on an ATA.
1943
+ *
1944
+ * Supports light-token, SPL, and Token-2022 mints.
1945
+ * Returns `TransactionInstruction[][]`. Send [0..n-2] in parallel, then [n-1].
1946
+ *
1947
+ * @remarks For light-token mints, all cold (compressed) balances are loaded
1948
+ * into the hot ATA before the revoke instruction. Users with many cold
1949
+ * accounts may see additional load transactions.
1950
+ *
1951
+ * @param rpc RPC connection
1952
+ * @param payer Fee payer public key
1953
+ * @param mint Mint address
1954
+ * @param tokenAccount ATA address
1955
+ * @param owner Owner public key
1956
+ * @param decimals Token decimals
1957
+ * @param programId Token program ID (default: LIGHT_TOKEN_PROGRAM_ID)
1958
+ * @param options Optional interface options (`wrap` is nested here)
1959
+ * @returns Instruction batches
1960
+ */
1961
+ declare function createRevokeInterfaceInstructions(rpc: Rpc, payer: PublicKey, mint: PublicKey, tokenAccount: PublicKey, owner: PublicKey, decimals: number, programId?: PublicKey, options?: InterfaceOptions): Promise<TransactionInstruction[][]>;
1962
+
1963
+ /**
1964
+ * Create and initialize a new mint for SPL/T22/light-token.
2050
1965
  *
2051
1966
  * @param rpc RPC connection to use
2052
1967
  * @param payer Fee payer
2053
- * @param mintAuthority Account that will control minting (signer for c-token mints)
1968
+ * @param mintAuthority Account that will control minting (signer for light-token mints)
2054
1969
  * @param freezeAuthority Account that will control freeze and thaw (optional)
2055
1970
  * @param decimals Location of the decimal place
2056
1971
  * @param keypair Mint keypair (defaults to a random keypair)
2057
1972
  * @param confirmOptions Confirm options
2058
1973
  * @param programId Token program ID (defaults to LIGHT_TOKEN_PROGRAM_ID)
2059
- * @param tokenMetadata Optional token metadata (c-token mints only)
2060
- * @param outputStateTreeInfo Optional output state tree info (c-token mints only)
2061
- * @param addressTreeInfo Optional address tree info (c-token mints only)
1974
+ * @param tokenMetadata Optional token metadata (light-token mints only)
1975
+ * @param outputStateTreeInfo Optional output state tree info (light-token mints only)
1976
+ * @param addressTreeInfo Optional address tree info (light-token mints only)
2062
1977
  *
2063
1978
  * @returns Object with mint address and transaction signature
2064
1979
  */
@@ -2068,8 +1983,8 @@ declare function createMintInterface(rpc: Rpc, payer: Signer, mintAuthority: Pub
2068
1983
  }>;
2069
1984
 
2070
1985
  /**
2071
- * Update the mint authority of a compressed token mint.
2072
- * Works for both compressed and decompressed mints.
1986
+ * Update the mint authority of a light-token mint.
1987
+ * Works for both compressed and decompressed light mints.
2073
1988
  *
2074
1989
  * @param rpc RPC connection
2075
1990
  * @param payer Fee payer (signer)
@@ -2080,8 +1995,8 @@ declare function createMintInterface(rpc: Rpc, payer: Signer, mintAuthority: Pub
2080
1995
  */
2081
1996
  declare function updateMintAuthority(rpc: Rpc, payer: Signer, mint: PublicKey, currentMintAuthority: Signer, newMintAuthority: PublicKey | null, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
2082
1997
  /**
2083
- * Update the freeze authority of a compressed token mint.
2084
- * Works for both compressed and decompressed mints.
1998
+ * Update the freeze authority of a light-token mint.
1999
+ * Works for both compressed and decompressed light mints.
2085
2000
  *
2086
2001
  * @param rpc RPC connection
2087
2002
  * @param payer Fee payer (signer)
@@ -2093,8 +2008,8 @@ declare function updateMintAuthority(rpc: Rpc, payer: Signer, mint: PublicKey, c
2093
2008
  declare function updateFreezeAuthority(rpc: Rpc, payer: Signer, mint: PublicKey, currentFreezeAuthority: Signer, newFreezeAuthority: PublicKey | null, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
2094
2009
 
2095
2010
  /**
2096
- * Update a metadata field on a compressed token mint.
2097
- * Works for both compressed and decompressed mints.
2011
+ * Update a metadata field on a light-token mint.
2012
+ * Works for both compressed and decompressed light mints.
2098
2013
  *
2099
2014
  * @param rpc RPC connection
2100
2015
  * @param payer Fee payer (signer)
@@ -2108,8 +2023,8 @@ declare function updateFreezeAuthority(rpc: Rpc, payer: Signer, mint: PublicKey,
2108
2023
  */
2109
2024
  declare function updateMetadataField(rpc: Rpc, payer: Signer, mint: PublicKey, authority: Signer, fieldType: 'name' | 'symbol' | 'uri' | 'custom', value: string, customKey?: string, extensionIndex?: number, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
2110
2025
  /**
2111
- * Update the metadata authority of a compressed token mint.
2112
- * Works for both compressed and decompressed mints.
2026
+ * Update the metadata authority of a light-token mint.
2027
+ * Works for both compressed and decompressed light mints.
2113
2028
  *
2114
2029
  * @param rpc RPC connection
2115
2030
  * @param payer Fee payer (signer)
@@ -2121,8 +2036,8 @@ declare function updateMetadataField(rpc: Rpc, payer: Signer, mint: PublicKey, a
2121
2036
  */
2122
2037
  declare function updateMetadataAuthority(rpc: Rpc, payer: Signer, mint: PublicKey, currentAuthority: Signer, newAuthority: PublicKey, extensionIndex?: number, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
2123
2038
  /**
2124
- * Remove a metadata key from a compressed token mint.
2125
- * Works for both compressed and decompressed mints.
2039
+ * Remove a metadata key from a light-token mint.
2040
+ * Works for both compressed and decompressed light mints.
2126
2041
  *
2127
2042
  * @param rpc RPC connection
2128
2043
  * @param payer Fee payer (signer)
@@ -2136,8 +2051,8 @@ declare function updateMetadataAuthority(rpc: Rpc, payer: Signer, mint: PublicKe
2136
2051
  declare function removeMetadataKey(rpc: Rpc, payer: Signer, mint: PublicKey, authority: Signer, key: string, idempotent?: boolean, extensionIndex?: number, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
2137
2052
 
2138
2053
  /**
2139
- * Create an associated token account for SPL/T22/c-token. Defaults to c-token
2140
- * program.
2054
+ * Create an associated token account for SPL/T22/light-token. Defaults to
2055
+ * light-token program.
2141
2056
  *
2142
2057
  * @param rpc RPC connection
2143
2058
  * @param payer Fee payer and transaction signer
@@ -2147,15 +2062,15 @@ declare function removeMetadataKey(rpc: Rpc, payer: Signer, mint: PublicKey, aut
2147
2062
  * @param confirmOptions Options for confirming the transaction
2148
2063
  * @param programId Token program ID (default:
2149
2064
  * LIGHT_TOKEN_PROGRAM_ID)
2150
- * @param associatedTokenProgramId ATA program ID (auto-derived if not
2151
- * provided)
2152
- * @param ctokenConfig Optional rent config
2065
+ * @param associatedTokenProgramId associated token account program ID
2066
+ * (auto-derived if not provided)
2067
+ * @param lightTokenConfig Optional rent config
2153
2068
  * @returns Address of the new associated token account
2154
2069
  */
2155
- declare function createAtaInterface(rpc: Rpc, payer: Signer, mint: PublicKey, owner: PublicKey, allowOwnerOffCurve?: boolean, confirmOptions?: ConfirmOptions, programId?: PublicKey, associatedTokenProgramId?: PublicKey, ctokenConfig?: CTokenConfig): Promise<PublicKey>;
2070
+ declare function createAtaInterface(rpc: Rpc, payer: Signer, mint: PublicKey, owner: PublicKey, allowOwnerOffCurve?: boolean, confirmOptions?: ConfirmOptions, programId?: PublicKey, associatedTokenProgramId?: PublicKey, lightTokenConfig?: LightTokenConfig): Promise<PublicKey>;
2156
2071
  /**
2157
- * Create an associated token account idempotently for SPL/T22/c-token. Defaults
2158
- * to c-token program.
2072
+ * Create an associated token account idempotently for SPL/T22/light-token.
2073
+ * Defaults to light-token program.
2159
2074
  *
2160
2075
  * If the account already exists, the instruction succeeds without error.
2161
2076
  *
@@ -2167,24 +2082,24 @@ declare function createAtaInterface(rpc: Rpc, payer: Signer, mint: PublicKey, ow
2167
2082
  * @param confirmOptions Options for confirming the transaction
2168
2083
  * @param programId Token program ID (default:
2169
2084
  * LIGHT_TOKEN_PROGRAM_ID)
2170
- * @param associatedTokenProgramId ATA program ID (auto-derived if not
2171
- * provided)
2172
- * @param ctokenConfig Optional c-token-specific configuration
2085
+ * @param associatedTokenProgramId associated token account program ID
2086
+ * (auto-derived if not provided)
2087
+ * @param lightTokenConfig Optional light-token-specific configuration
2173
2088
  *
2174
2089
  * @returns Address of the associated token account
2175
2090
  */
2176
- declare function createAtaInterfaceIdempotent(rpc: Rpc, payer: Signer, mint: PublicKey, owner: PublicKey, allowOwnerOffCurve?: boolean, confirmOptions?: ConfirmOptions, programId?: PublicKey, associatedTokenProgramId?: PublicKey, ctokenConfig?: CTokenConfig): Promise<PublicKey>;
2091
+ declare function createAtaInterfaceIdempotent(rpc: Rpc, payer: Signer, mint: PublicKey, owner: PublicKey, allowOwnerOffCurve?: boolean, confirmOptions?: ConfirmOptions, programId?: PublicKey, associatedTokenProgramId?: PublicKey, lightTokenConfig?: LightTokenConfig): Promise<PublicKey>;
2177
2092
 
2178
2093
  /**
2179
- * Mint tokens to a CToken account.
2094
+ * Mint tokens to a light-token account.
2180
2095
  *
2181
- * This is a simple mint instruction for minting to decompressed CToken accounts.
2182
- * The mint must be decompressed (CMint account must exist on-chain).
2096
+ * This is a simple mint instruction for minting to light-token associated token accounts (hot).
2097
+ * The light mint account must exist (mint must be decompressed first).
2183
2098
  *
2184
2099
  * @param rpc - RPC connection
2185
2100
  * @param payer - Fee payer (signer)
2186
- * @param mint - Mint address (CMint account)
2187
- * @param destination - Destination CToken account
2101
+ * @param mint - Mint address (light mint account)
2102
+ * @param destination - Destination light-token account
2188
2103
  * @param authority - Mint authority (signer)
2189
2104
  * @param amount - Amount to mint
2190
2105
  * @param maxTopUp - Optional maximum lamports for rent top-up
@@ -2194,7 +2109,7 @@ declare function createAtaInterfaceIdempotent(rpc: Rpc, payer: Signer, mint: Pub
2194
2109
  declare function mintTo$1(rpc: Rpc, payer: Signer, mint: PublicKey, destination: PublicKey, authority: Signer, amount: number | bigint, maxTopUp?: number, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
2195
2110
 
2196
2111
  /**
2197
- * Mint compressed tokens directly to compressed accounts.
2112
+ * Mint light-tokens directly to compressed accounts.
2198
2113
  *
2199
2114
  * @param rpc RPC connection
2200
2115
  * @param payer Fee payer
@@ -2203,25 +2118,26 @@ declare function mintTo$1(rpc: Rpc, payer: Signer, mint: PublicKey, destination:
2203
2118
  * @param recipients Array of recipients with amounts
2204
2119
  * @param outputStateTreeInfo Optional output state tree info (auto-fetched if not provided)
2205
2120
  * @param tokenAccountVersion Token account version (default: 3)
2121
+ * @param maxTopUp Optional: cap on rent top-up (units of 1k lamports; default no cap)
2206
2122
  * @param confirmOptions Optional confirm options
2207
2123
  */
2208
2124
  declare function mintToCompressed(rpc: Rpc, payer: Signer, mint: PublicKey, authority: Signer, recipients: Array<{
2209
2125
  recipient: PublicKey;
2210
2126
  amount: number | bigint;
2211
- }>, outputStateTreeInfo?: TreeInfo, tokenAccountVersion?: number, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
2127
+ }>, outputStateTreeInfo?: TreeInfo, tokenAccountVersion?: number, maxTopUp?: number, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
2212
2128
 
2213
2129
  /**
2214
2130
  * Mint tokens to a decompressed/onchain token account.
2215
- * Works with SPL, Token-2022, and CToken mints.
2131
+ * Works with SPL, Token-2022, and light-token mints.
2216
2132
  *
2217
- * This function ONLY mints to decompressed onchain token accounts, never to compressed accounts.
2218
- * For CToken mints, the mint must be decompressed first (CMint account must exist on-chain).
2133
+ * This function ONLY mints to light-token associated token accounts (hot), never to compressed light-token accounts (cold).
2134
+ * For light-token mints, the light mint account must exist (mint must be decompressed first).
2219
2135
  *
2220
2136
  * The signature matches the standard SPL mintTo for simplicity and consistency.
2221
2137
  *
2222
2138
  * @param rpc - RPC connection to use
2223
2139
  * @param payer - Transaction fee payer
2224
- * @param mint - Mint address (SPL, Token-2022, or CToken mint)
2140
+ * @param mint - Mint address (SPL, Token-2022, or light-token mint)
2225
2141
  * @param destination - Destination token account address (must be an existing onchain token account)
2226
2142
  * @param authority - Mint authority (can be Signer or PublicKey if multiSigners provided)
2227
2143
  * @param amount - Amount to mint
@@ -2242,7 +2158,7 @@ declare function mintToInterface(rpc: Rpc, payer: Signer, mint: PublicKey, desti
2242
2158
  * @param mint Mint associated with the account to set or
2243
2159
  * verify.
2244
2160
  * @param owner Owner of the account. Pass Signer to
2245
- * auto-load cold (compressed) tokens, or
2161
+ * auto-load compressed light-tokens (cold balance), or
2246
2162
  * PublicKey for read-only.
2247
2163
  * @param allowOwnerOffCurve Allow the owner account to be a PDA (Program
2248
2164
  * Derived Address).
@@ -2259,48 +2175,31 @@ declare function mintToInterface(rpc: Rpc, payer: Signer, mint: PublicKey, desti
2259
2175
  declare function getOrCreateAtaInterface(rpc: Rpc, payer: Signer, mint: PublicKey, owner: PublicKey | Signer, allowOwnerOffCurve?: boolean, commitment?: Commitment, confirmOptions?: ConfirmOptions, programId?: PublicKey, associatedTokenProgramId?: PublicKey): Promise<AccountInterface>;
2260
2176
 
2261
2177
  /**
2262
- * Decompress compressed (cold) tokens to an on-chain token account.
2263
- *
2264
- * For unified loading, use {@link loadAta} instead.
2265
- *
2266
- * @param rpc RPC connection
2267
- * @param payer Fee payer (signer)
2268
- * @param owner Owner of the compressed tokens (signer)
2269
- * @param mint Mint address
2270
- * @param amount Amount to decompress (defaults to all)
2271
- * @param destinationAta Destination token account address
2272
- * @param destinationOwner Owner of the destination ATA
2273
- * @param splInterfaceInfo SPL interface info for SPL/T22 destinations
2274
- * @param confirmOptions Confirm options
2275
- * @returns Transaction signature, null if nothing to load.
2276
- */
2277
- declare function decompressInterface(rpc: Rpc, payer: Signer, owner: Signer, mint: PublicKey, amount?: number | bigint | BN, destinationAta?: PublicKey, destinationOwner?: PublicKey, splInterfaceInfo?: SplInterfaceInfo, confirmOptions?: ConfirmOptions): Promise<TransactionSignature | null>;
2278
-
2279
- /**
2280
- * Wrap tokens from an SPL/T22 account to a c-token account.
2178
+ * Wrap tokens from an SPL/T22 account to a light-token account.
2281
2179
  *
2282
2180
  * This is an agnostic action that takes explicit account addresses (spl-token style).
2283
- * Use getAssociatedTokenAddressSync() to derive ATA addresses if needed.
2181
+ * Use getAssociatedTokenAddressSync() to derive associated token account addresses if needed.
2284
2182
  *
2285
2183
  * @param rpc RPC connection
2286
2184
  * @param payer Fee payer
2287
- * @param source Source SPL/T22 token account (any token account, not just ATA)
2288
- * @param destination Destination c-token account
2185
+ * @param source Source SPL/T22 token account (any token account, not just associated token account)
2186
+ * @param destination Destination light-token account
2289
2187
  * @param owner Owner/authority of the source account (must sign)
2290
2188
  * @param mint Mint address
2291
2189
  * @param amount Amount to wrap
2292
2190
  * @param splInterfaceInfo Optional: SPL interface info (will be fetched if not provided)
2191
+ * @param maxTopUp Optional: cap on rent top-up (units of 1k lamports; default no cap)
2293
2192
  * @param confirmOptions Optional: Confirm options
2294
2193
  *
2295
2194
  * @example
2296
2195
  * const splAta = getAssociatedTokenAddressSync(mint, owner.publicKey, false, TOKEN_PROGRAM_ID);
2297
- * const ctokenAta = getAssociatedTokenAddressInterface(mint, owner.publicKey); // defaults to c-token
2196
+ * const lightTokenAta = getAssociatedTokenAddressInterface(mint, owner.publicKey); // defaults to light-token
2298
2197
  *
2299
2198
  * await wrap(
2300
2199
  * rpc,
2301
2200
  * payer,
2302
2201
  * splAta,
2303
- * ctokenAta,
2202
+ * lightTokenAta,
2304
2203
  * owner,
2305
2204
  * mint,
2306
2205
  * 1000n,
@@ -2308,76 +2207,60 @@ declare function decompressInterface(rpc: Rpc, payer: Signer, owner: Signer, min
2308
2207
  *
2309
2208
  * @returns Transaction signature
2310
2209
  */
2311
- declare function wrap(rpc: Rpc, payer: Signer, source: PublicKey, destination: PublicKey, owner: Signer, mint: PublicKey, amount: bigint, splInterfaceInfo?: SplInterfaceInfo, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
2210
+ 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>;
2312
2211
 
2313
2212
  /**
2314
- * Build instruction batches for unwrapping c-tokens to SPL/T22 tokens.
2213
+ * Approve a delegate for an associated token account.
2315
2214
  *
2316
- * Returns `TransactionInstruction[][]` with the same shape as
2317
- * `createLoadAtaInstructions` and `createTransferInterfaceInstructions`:
2318
- * each inner array is one transaction. Load batches (if any) come first,
2319
- * followed by one final unwrap transaction.
2215
+ * Supports light-token, SPL, and Token-2022 mints. For light-token mints,
2216
+ * loads cold accounts if needed before sending the approve instruction.
2320
2217
  *
2321
- * Uses amount-aware input selection: only loads the cold inputs needed to
2322
- * cover the unwrap amount (plus padding to fill a single proof batch).
2218
+ * @remarks For light-token mints, all cold (compressed) balances are loaded
2219
+ * into the hot ATA, not just the delegation amount. The `amount` parameter
2220
+ * only controls the delegate's spending limit.
2323
2221
  *
2324
- * @param rpc RPC connection
2325
- * @param destination Destination SPL/T22 token account (must exist)
2326
- * @param owner Owner of the c-token
2327
- * @param mint Mint address
2328
- * @param amount Amount to unwrap (defaults to full balance)
2329
- * @param payer Fee payer (defaults to owner)
2330
- * @param splInterfaceInfo Optional: SPL interface info
2331
- * @param interfaceOptions Optional: interface options for load
2332
- * @param wrap Whether to use unified (wrap) mode for loading.
2333
- * Default false.
2334
- * @returns Instruction batches - each inner array is one transaction
2222
+ * @param rpc RPC connection
2223
+ * @param payer Fee payer (signer)
2224
+ * @param tokenAccount ATA address
2225
+ * @param mint Mint address
2226
+ * @param delegate Delegate to approve
2227
+ * @param amount Amount to delegate
2228
+ * @param owner Owner of the token account (signer)
2229
+ * @param confirmOptions Optional confirm options
2230
+ * @param programId Token program ID (default: LIGHT_TOKEN_PROGRAM_ID)
2231
+ * @param options Optional interface options (`wrap` is nested here)
2232
+ * @returns Transaction signature
2335
2233
  */
2336
- declare function createUnwrapInstructions(rpc: Rpc, destination: PublicKey, owner: PublicKey, mint: PublicKey, amount?: number | bigint | BN, payer?: PublicKey, splInterfaceInfo?: SplInterfaceInfo, interfaceOptions?: InterfaceOptions, wrap?: boolean): Promise<TransactionInstruction[][]>;
2337
-
2234
+ declare function approveInterface(rpc: Rpc, payer: Signer, tokenAccount: PublicKey, mint: PublicKey, delegate: PublicKey, amount: number | bigint | BN, owner: Signer, confirmOptions?: ConfirmOptions, programId?: PublicKey, options?: InterfaceOptions, decimals?: number): Promise<TransactionSignature>;
2338
2235
  /**
2339
- * Select compressed inputs for a target amount.
2340
- *
2341
- * Sorts by amount descending (largest first), accumulates until the target
2342
- * is met, then pads to {@link MAX_INPUT_ACCOUNTS} if possible within a
2343
- * single batch.
2236
+ * Revoke delegation for an associated token account.
2344
2237
  *
2345
- * - If the amount is covered by N <= 8 inputs, returns min(8, total) inputs.
2346
- * - If more than 8 inputs are needed, returns exactly as many as required
2347
- * (no padding beyond the amount-needed count).
2348
- * - Returns [] when `neededAmount <= 0` or `accounts` is empty.
2349
- *
2350
- * @param accounts Cold compressed token accounts available for loading.
2351
- * @param neededAmount Amount that must be covered by selected inputs.
2352
- * @returns Subset of `accounts`, sorted largest-first.
2353
- */
2354
- declare function selectInputsForAmount(accounts: ParsedTokenAccount[], neededAmount: bigint): ParsedTokenAccount[];
2355
- /**
2356
- * Create instructions to load an ATA from its AccountInterface.
2238
+ * Supports light-token, SPL, and Token-2022 mints. For light-token mints,
2239
+ * loads cold accounts if needed before sending the revoke instruction.
2357
2240
  *
2358
- * Behavior depends on `wrap` parameter:
2359
- * - wrap=false (standard): Decompress compressed tokens to the target ATA type
2360
- * (SPL ATA via pool, T22 ATA via pool, or c-token ATA direct)
2361
- * - wrap=true (unified): Wrap SPL/T22 + decompress all to c-token ATA
2241
+ * @remarks For light-token mints, all cold (compressed) balances are loaded
2242
+ * into the hot ATA before the revoke instruction.
2362
2243
  *
2363
- * @param rpc RPC connection
2364
- * @param payer Fee payer
2365
- * @param ata AccountInterface from getAtaInterface (must have _isAta, _owner, _mint)
2366
- * @param options Optional load options
2367
- * @param wrap Unified mode: wrap SPL/T22 to c-token (default: false)
2368
- * @param targetAta Target ATA address (used for type detection in standard mode)
2369
- * @returns Array of instructions (empty if nothing to load)
2244
+ * @param rpc RPC connection
2245
+ * @param payer Fee payer (signer)
2246
+ * @param tokenAccount ATA address
2247
+ * @param mint Mint address
2248
+ * @param owner Owner of the token account (signer)
2249
+ * @param confirmOptions Optional confirm options
2250
+ * @param programId Token program ID (default: LIGHT_TOKEN_PROGRAM_ID)
2251
+ * @param options Optional interface options (`wrap` is nested here)
2252
+ * @returns Transaction signature
2370
2253
  */
2371
- declare function createLoadAtaInstructionsFromInterface(rpc: Rpc, payer: PublicKey, ata: AccountInterface, options?: InterfaceOptions, wrap?: boolean, targetAta?: PublicKey): Promise<TransactionInstruction[]>;
2254
+ declare function revokeInterface(rpc: Rpc, payer: Signer, tokenAccount: PublicKey, mint: PublicKey, owner: Signer, confirmOptions?: ConfirmOptions, programId?: PublicKey, options?: InterfaceOptions, decimals?: number): Promise<TransactionSignature>;
2372
2255
 
2373
2256
  /**
2374
- * Derive the canonical associated token address for any of SPL/T22/c-token.
2375
- * Defaults to using c-token as the canonical ATA.
2257
+ * Derive the canonical associated token address for any of SPL/T22/light-token.
2258
+ * Defaults to using light-token as the canonical associated token account.
2376
2259
  *
2377
2260
  * @param mint Mint public key
2378
2261
  * @param owner Owner public key
2379
2262
  * @param allowOwnerOffCurve Allow owner to be a PDA. Default false.
2380
- * @param programId Token program ID. Default c-token.
2263
+ * @param programId Token program ID. Default light-token.
2381
2264
  *
2382
2265
  * @param associatedTokenProgramId Associated token program ID. Default
2383
2266
  * auto-detected.
@@ -2433,7 +2316,7 @@ interface OffChainTokenMetadataJson {
2433
2316
  * const metadataJson = toOffChainMetadataJson({
2434
2317
  * name: 'My Token',
2435
2318
  * symbol: 'MTK',
2436
- * description: 'A compressed token',
2319
+ * description: 'A light-token',
2437
2320
  * image: 'https://example.com/image.png',
2438
2321
  * });
2439
2322
  * const uri = await umi.uploader.uploadJson(metadataJson);
@@ -5716,7 +5599,7 @@ declare function getAtaInterface(rpc: Rpc, ata: PublicKey, owner: PublicKey, min
5716
5599
  */
5717
5600
  declare function createLoadAtaInstructions(rpc: Rpc, ata: PublicKey, owner: PublicKey, mint: PublicKey, payer?: PublicKey, options?: InterfaceOptions): Promise<TransactionInstruction[][]>;
5718
5601
  /**
5719
- * Load token balances into a c-token ATA.
5602
+ * Load token balances into a light-token ATA.
5720
5603
  *
5721
5604
  * @param rpc RPC connection
5722
5605
  * @param ata Associated token address
@@ -5727,6 +5610,6 @@ declare function createLoadAtaInstructions(rpc: Rpc, ata: PublicKey, owner: Publ
5727
5610
  * @param interfaceOptions Optional interface options
5728
5611
  * @returns Transaction signature, or null if nothing to load
5729
5612
  */
5730
- declare function loadAta(rpc: Rpc, ata: PublicKey, owner: Signer, mint: PublicKey, payer?: Signer, confirmOptions?: ConfirmOptions, interfaceOptions?: InterfaceOptions): Promise<TransactionSignature | null>;
5613
+ declare function loadAta(rpc: Rpc, ata: PublicKey, owner: Signer, mint: PublicKey, payer?: Signer, confirmOptions?: ConfirmOptions, interfaceOptions?: InterfaceOptions, decimals?: number): Promise<TransactionSignature | null>;
5731
5614
 
5732
- 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_CTOKEN_ACCOUNT_SIZE, COMPRESSIBLE_CTOKEN_RENT_PER_EPOCH, COMPRESSION_COST, COMPRESSION_INCENTIVE, COMPRESS_SPL_TOKEN_ACCOUNT_DISCRIMINATOR, CPI_AUTHORITY_SEED, CREATE_TOKEN_POOL_DISCRIMINATOR, type CTokenConfig, type CompressParams, type CompressSplTokenAccountInstructionData, type CompressSplTokenAccountParams, type CompressedMint, type CompressedTokenInstructionDataApprove, CompressedTokenInstructionDataApproveLayout, type CompressedTokenInstructionDataRevoke, CompressedTokenInstructionDataRevokeLayout, type CompressedTokenInstructionDataTransfer, CompressedTokenInstructionDataTransferLayout, CompressedTokenProgram, type CompressibleAccountInput, type CompressibleConfig, type CompressibleLoadParams, CpiContextLayout, type CreateAssociatedCTokenAccountParams, type CreateMintParams, type CreateSplInterfaceParams, type CreateTokenPoolParams, type CreateTokenProgramLookupTableParams, DECOMPRESS_ACCOUNTS_IDEMPOTENT_DISCRIMINATOR, 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, CompressedTokenProgram as LightTokenProgram, type LoadResult, MAX_COMBINED_BATCH_BYTES, MAX_LOAD_ONLY_BATCH_BYTES, 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 PackedCompressedAccount, type PackedTokenTransferOutputData, type ParsedAccountInfoInterface, 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, calculateCompressibleLoadComputeUnits, calculateFeePayerCostAtCreation, checkMint, checkSplInterfaceInfo, checkTokenPoolInfo, compress, compressSplTokenAccount, compressSplTokenAccountInstructionDataLayout, convertTokenDataToAccount, createAssociatedCTokenAccountIdempotentInstruction, createAssociatedCTokenAccountInstruction, createAssociatedTokenAccountInterfaceIdempotentInstruction, createAssociatedTokenAccountInterfaceInstruction, createAtaInterface, createAtaInterfaceIdempotent, createAtaInterfaceIdempotentInstruction, createDecompressInterfaceInstruction, createDecompressOutputState, createLightTokenTransferInstruction, createLoadAccountsParams, createLoadAtaInstructions, createLoadAtaInstructionsFromInterface, 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, decompressInterface, 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, mintTo$1 as mintToCToken, mintToCompressed, mintToInterface, mintToLayout, packCompressedTokenAccounts, parseCTokenCold, parseCTokenHot, 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 };
5615
+ 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 };