Calling the Token Program via CPI
Invoke the Token Program from an onchain program — transfer, mint, and burn
tokens, sign with a PDA authority, and batch instructions into a single CPI.
Withdraw Excess Lamports
Recover SOL above the rent-exempt minimum from token accounts, mints, and
multisig accounts without changing token balances.
Unwrap Lamports
Convert wrapped SOL back into lamports, in full or in part, without closing
the token account.
WithdrawExcessLamports and UnwrapLamports are available through the
@solana-program/token
client. Calling the Token Program via CPI applies to onchain programs.Lamport recovery
WithdrawExcessLamports recovers SOL above the rent-exempt minimum from
token accounts, mints, and multisig accounts. UnwrapLamports converts
wrapped SOL in a native token account back into lamports.