light_token_interface/instructions/extensions/compressed_only.rs
1use light_zero_copy::ZeroCopy;
2
3use crate::{AnchorDeserialize, AnchorSerialize};
4
5/// CompressedOnly extension instruction data for compressed token accounts.
6/// This extension marks a compressed account as decompress-only (cannot be transferred).
7#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, AnchorSerialize, AnchorDeserialize, ZeroCopy)]
8#[repr(C)]
9pub struct CompressedOnlyExtensionInstructionData {
10 /// The delegated amount from the source Token account's delegate field.
11 /// When decompressing, the decompression amount must match this value.
12 pub delegated_amount: u64,
13 /// Withheld transfer fee amount
14 pub withheld_transfer_fee: u64,
15 /// Whether the source Token account was frozen when compressed.
16 pub is_frozen: bool,
17 /// Index of the compression operation that consumes this input.
18 pub compression_index: u8,
19 /// Whether the source Token account was an ATA.
20 /// When is_ata=true, decompress must verify ATA derivation matches.
21 pub is_ata: bool,
22 /// ATA derivation bump (only used when is_ata=true).
23 pub bump: u8,
24 /// Index into packed_accounts for the actual owner (only used when is_ata=true).
25 /// For ATA decompress: this is the wallet owner who signs. The program derives
26 /// ATA from (owner, program_id, mint, bump) and verifies it matches the
27 /// compressed account owner (which is the ATA pubkey).
28 pub owner_index: u8,
29}