@lightprotocol/compressed-token - v0.23.0-beta.8
    Preparing search index...

    Function createUnwrapInstructions

    • Build instruction batches for unwrapping light-tokens to SPL/T22 tokens.

      Returns TransactionInstruction[][] with the same shape as createLoadAtaInstructions and createTransferInterfaceInstructions: each inner array is one transaction. Load batches (if any) come first, followed by one final unwrap transaction.

      Uses amount-aware input selection: only loads the cold inputs needed to cover the unwrap amount (plus padding to fill a single proof batch).

      Parameters

      • rpc: Rpc

        RPC connection

      • destination: PublicKey

        Destination SPL/T22 token account (must exist)

      • owner: PublicKey

        Owner of the light-token

      • mint: PublicKey

        Mint address

      • Optionalamount: number | bigint | BN

        Amount to unwrap (defaults to full balance)

      • Optionalpayer: PublicKey

        Fee payer (defaults to owner)

      • OptionalsplInterfaceInfo: SplInterfaceInfo

        Optional: SPL interface info

      • OptionalmaxTopUp: number

        Optional: cap on rent top-up (units of 1k lamports; default no cap)

      • OptionalinterfaceOptions: InterfaceOptions

        Optional: interface options for load

      • wrap: boolean = false

        Whether to use unified (wrap) mode for loading. Default false.

      Returns Promise<TransactionInstruction[][]>

      Instruction batches - each inner array is one transaction