Module ctoken

Module ctoken 

Source
Expand description

Compressed Token (CToken) program instruction decoder.

This module provides a macro-derived decoder for the Light Token (CToken) program, which uses non-sequential 1-byte discriminators for Pinocchio instructions.

Note: This decoder only handles Pinocchio (1-byte) instructions. Anchor (8-byte) instructions are not decoded by this macro-derived decoder.

§Instruction Data Formats

Most CToken instructions have optional max_top_up suffix:

  • Transfer, MintTo, Burn: 8 bytes (amount) or 10 bytes (amount + max_top_up)
  • TransferChecked, MintToChecked, BurnChecked: 9 bytes (amount + decimals) or 11 bytes (+ max_top_up)
  • Approve: 8 bytes (amount) or 10 bytes (amount + max_top_up)
  • Revoke: 0 bytes or 2 bytes (max_top_up)

Structs§

CTokenInstructionDecoder
Generated InstructionDecoder implementation

Enums§

CTokenInstruction
Compressed Token (CToken) program instructions.

Functions§

format_mint_action
Format MintAction instruction data with resolved pubkeys.
format_transfer2
Format Transfer2 instruction data with resolved pubkeys.
resolve_mint_action_account_names
Resolve MintAction account names dynamically based on instruction data.
resolve_transfer2_account_names
Resolve Transfer2 account names dynamically based on instruction data.