Skip to main content
transferDelegatedInterface transfers tokens from an associated token account as an approved delegate. The delegate is the transaction authority. Only the delegate and fee payer sign; the owner’s signature is not required.
  • The recipient is a wallet address (associated token account derived and created internally)
  • The amount must be within the approved allowance
  • Each transfer reduces the remaining allowance
Install the agent skill:
npx skills add https://zkcompression.com
See the AI tools guide for dedicated skills.
1

Delegated Transfer

Install packages in your working directory:
npm install @lightprotocol/stateless.js@beta \
            @lightprotocol/compressed-token@beta
Install the CLI globally:
npm install -g @lightprotocol/zk-compression-cli@beta
# start local test-validator in a separate terminal
light test-validator
In the code examples, use createRpc() without arguments for localnet.
import { Keypair } from "@solana/web3.js";
import { transferDelegatedInterface } from "@lightprotocol/compressed-token/unified";
import { rpc, payer, setup } from "../setup.js";

(async function () {
    const { mint, senderAta } = await setup();

    // Approve a delegate first (see delegate-approve.mdx)
    const delegate = Keypair.generate();
    const recipient = Keypair.generate();

    // Delegate transfers tokens on behalf of the owner
    const tx = await transferDelegatedInterface(
        rpc,
        payer,
        senderAta,
        mint,
        recipient.publicKey,
        delegate,
        payer.publicKey,
        200_000
    );

    console.log("Delegated transfer:", tx);
})();

Approve and revoke

Payments overview


Didn’t find what you were looking for?

Reach out! Telegram | email | Discord