From 41beedb8896e08cc632d50bd2809f9634f11c88a Mon Sep 17 00:00:00 2001 From: tilo-14 Date: Fri, 27 Feb 2026 19:32:01 +0000 Subject: [PATCH 1/4] Add sponsor-rent-top-ups toolkit Entire-Checkpoint: 4afa49be1970 --- .gitignore | 4 +- toolkits/README.md | 6 + toolkits/sponsor-rent-top-ups/README.md | 39 +++++ toolkits/sponsor-rent-top-ups/rust/Cargo.toml | 19 +++ toolkits/sponsor-rent-top-ups/rust/setup.rs | 156 ++++++++++++++++++ .../rust/sponsor-top-ups.rs | 56 +++++++ .../typescript/package.json | 13 ++ .../sponsor-rent-top-ups/typescript/setup.ts | 43 +++++ .../typescript/sponsor-top-ups.ts | 46 ++++++ .../typescript/tsconfig.json | 15 ++ 10 files changed, 396 insertions(+), 1 deletion(-) create mode 100644 toolkits/sponsor-rent-top-ups/README.md create mode 100644 toolkits/sponsor-rent-top-ups/rust/Cargo.toml create mode 100644 toolkits/sponsor-rent-top-ups/rust/setup.rs create mode 100644 toolkits/sponsor-rent-top-ups/rust/sponsor-top-ups.rs create mode 100644 toolkits/sponsor-rent-top-ups/typescript/package.json create mode 100644 toolkits/sponsor-rent-top-ups/typescript/setup.ts create mode 100644 toolkits/sponsor-rent-top-ups/typescript/sponsor-top-ups.ts create mode 100644 toolkits/sponsor-rent-top-ups/typescript/tsconfig.json diff --git a/.gitignore b/.gitignore index 3bc9411..bc19e74 100644 --- a/.gitignore +++ b/.gitignore @@ -26,4 +26,6 @@ cli/accounts/ bugs.md -.surfpool/ \ No newline at end of file +.surfpool/ +.entire/ +**/Cargo.lock \ No newline at end of file diff --git a/toolkits/README.md b/toolkits/README.md index 62bad80..8046ae2 100644 --- a/toolkits/README.md +++ b/toolkits/README.md @@ -23,6 +23,12 @@ Light-token operations signed with [Privy](https://privy.io) wallets. Server-sid [Rust program example to stream mint events](streaming-tokens/) of the Light-Token Program. +### Sponsor Rent Top-Ups + +Sponsor rent top-ups for users by setting your application as the fee payer. +- **[TypeScript](sponsor-rent-top-ups/typescript/)** - Sponsored Light transfer +- **[Rust](sponsor-rent-top-ups/rust/)** - Sponsored Light transfer + ## Documentation Learn more [about Light-Token here](https://www.zkcompression.com/light-token/welcome). diff --git a/toolkits/sponsor-rent-top-ups/README.md b/toolkits/sponsor-rent-top-ups/README.md new file mode 100644 index 0000000..689224b --- /dev/null +++ b/toolkits/sponsor-rent-top-ups/README.md @@ -0,0 +1,39 @@ +# Sponsor Rent Top-Ups + +Light Token sponsors rent-exemption for Solana accounts and keeps them active through periodic top-ups paid by the fee payer. Set your application as the fee payer to abstract away holding SOL from your users — a rent-free experience similar to transaction fee sponsorship. + +- **[TypeScript](typescript/)** — Sponsored transfer using `@lightprotocol/compressed-token` +- **[Rust](rust/)** — Sponsored transfer using `light-sdk-client` + +Set the `feePayer` field to the public key of the account that will pay the top-ups. Any account that signs the transaction can be the fee payer. + +1. Build the transfer instruction with your server as the `feePayer` +2. User signs to authorize the transfer (no SOL needed) +3. Fee payer covers rent top-ups when the transaction lands + +> You can set the fee payer to any signing account on any transaction with Light Token. + +## Source files + +- **[sponsor-top-ups.ts](typescript/sponsor-top-ups.ts)** / **[sponsor-top-ups.rs](rust/sponsor-top-ups.rs)** — Sponsored transfer: creates recipient ATA, transfers tokens with sponsor as fee payer +- **[setup.ts](typescript/setup.ts)** / **[setup.rs](rust/setup.rs)** — Test setup: creates SPL mint, mints tokens, wraps into Light + +## Setup + +```bash +cd typescript +npm install +``` + +For localnet: + +```bash +npm i -g @lightprotocol/zk-compression-cli@beta +light test-validator +npm run sponsor-top-ups +``` + +## Documentation + +- [Sponsor rent top-ups](https://www.zkcompression.com/light-token/toolkits/sponsor-top-ups) +- [Light Token overview](https://www.zkcompression.com/light-token/welcome) diff --git a/toolkits/sponsor-rent-top-ups/rust/Cargo.toml b/toolkits/sponsor-rent-top-ups/rust/Cargo.toml new file mode 100644 index 0000000..2ee2aeb --- /dev/null +++ b/toolkits/sponsor-rent-top-ups/rust/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "sponsor-rent-top-ups" +version = "0.1.0" +edition = "2021" +publish = false + +[[bin]] +name = "sponsor-top-ups" +path = "sponsor-top-ups.rs" + +[dependencies] +light-token = "0.23.0" +light-program-test = "0.23.0" +light-client = "0.23.0" +anchor-spl = "0.31" +solana-sdk = "2" +spl-token = "7" +tokio = { version = "1", features = ["full"] } +blake3 = "=1.5.5" diff --git a/toolkits/sponsor-rent-top-ups/rust/setup.rs b/toolkits/sponsor-rent-top-ups/rust/setup.rs new file mode 100644 index 0000000..89ec34d --- /dev/null +++ b/toolkits/sponsor-rent-top-ups/rust/setup.rs @@ -0,0 +1,156 @@ +// Test setup: creates an SPL mint, funds the sponsor, wraps into Light. +// In production the mint already exists (e.g. USDC) and the sender +// already holds Light tokens. + +use anchor_spl::{ + associated_token::spl_associated_token_account, + token::{spl_token, Mint as SPLMint}, +}; +use light_client::rpc::Rpc; +use light_program_test::LightProgramTest; +use light_token::{ + instruction::{ + get_associated_token_address, CreateAssociatedTokenAccount, SplInterface, + TransferInterface, LIGHT_TOKEN_PROGRAM_ID, + }, + spl_interface::CreateSplInterfacePda, +}; +#[allow(deprecated)] +use solana_sdk::{pubkey::Pubkey, signature::Keypair, signer::Signer, system_instruction}; + +pub struct SetupResult { + pub mint: Pubkey, + pub sender_ata: Pubkey, +} + +async fn setup_spl_mint(rpc: &mut LightProgramTest, payer: &Keypair, decimals: u8) -> Pubkey { + let mint_keypair = Keypair::new(); + let mint = mint_keypair.pubkey(); + + let mint_rent = rpc + .get_minimum_balance_for_rent_exemption(SPLMint::LEN) + .await + .unwrap(); + + let create_mint_instruction = system_instruction::create_account( + &payer.pubkey(), + &mint, + mint_rent, + SPLMint::LEN as u64, + &spl_token::ID, + ); + + let init_mint_instruction = spl_token::instruction::initialize_mint( + &spl_token::ID, + &mint, + &payer.pubkey(), + None, + decimals, + ) + .unwrap(); + + rpc.create_and_send_transaction( + &[create_mint_instruction, init_mint_instruction], + &payer.pubkey(), + &[payer, &mint_keypair], + ) + .await + .unwrap(); + + let create_interface_instruction = + CreateSplInterfacePda::new(payer.pubkey(), mint, spl_token::ID, false).instruction(); + + rpc.create_and_send_transaction(&[create_interface_instruction], &payer.pubkey(), &[payer]) + .await + .unwrap(); + + mint +} + +async fn setup_spl_associated_token_account( + rpc: &mut LightProgramTest, + payer: &Keypair, + mint: &Pubkey, + owner: &Pubkey, + amount: u64, +) -> Pubkey { + let associated_token_account = + spl_associated_token_account::get_associated_token_address(owner, mint); + + let create_ata_instruction = + spl_associated_token_account::instruction::create_associated_token_account_idempotent( + &payer.pubkey(), + owner, + mint, + &spl_token::ID, + ); + + let mut instructions = vec![create_ata_instruction]; + + if amount > 0 { + let mint_instruction = spl_token::instruction::mint_to( + &spl_token::ID, + mint, + &associated_token_account, + &payer.pubkey(), + &[], + amount, + ) + .unwrap(); + instructions.push(mint_instruction); + } + + rpc.create_and_send_transaction(&instructions, &payer.pubkey(), &[payer]) + .await + .unwrap(); + + associated_token_account +} + +pub async fn setup( + rpc: &mut LightProgramTest, + sponsor: &Keypair, + sender: &Keypair, +) -> Result> { + let decimals = 6u8; + let amount = 1_000_000u64; + + let mint = setup_spl_mint(rpc, sponsor, decimals).await; + let sponsor_spl_ata = setup_spl_associated_token_account( + rpc, sponsor, &mint, &sponsor.pubkey(), amount, + ).await; + let (interface_pda, interface_bump) = + light_token::spl_interface::find_spl_interface_pda_with_index(&mint, 0, false); + + let sender_ata = get_associated_token_address(&sender.pubkey(), &mint); + let create_ata_ix = + CreateAssociatedTokenAccount::new(sponsor.pubkey(), sender.pubkey(), mint).instruction()?; + rpc.create_and_send_transaction(&[create_ata_ix], &sponsor.pubkey(), &[sponsor]) + .await?; + + let spl_interface = SplInterface { + mint, + spl_token_program: spl_token::ID, + spl_interface_pda: interface_pda, + spl_interface_pda_bump: interface_bump, + }; + + let wrap_ix = TransferInterface { + source: sponsor_spl_ata, + destination: sender_ata, + amount, + decimals, + mint, + authority: sponsor.pubkey(), + payer: sponsor.pubkey(), + spl_interface: Some(spl_interface), + source_owner: spl_token::ID, + destination_owner: LIGHT_TOKEN_PROGRAM_ID, + } + .instruction()?; + + rpc.create_and_send_transaction(&[wrap_ix], &sponsor.pubkey(), &[sponsor]) + .await?; + + Ok(SetupResult { mint, sender_ata }) +} diff --git a/toolkits/sponsor-rent-top-ups/rust/sponsor-top-ups.rs b/toolkits/sponsor-rent-top-ups/rust/sponsor-top-ups.rs new file mode 100644 index 0000000..645e176 --- /dev/null +++ b/toolkits/sponsor-rent-top-ups/rust/sponsor-top-ups.rs @@ -0,0 +1,56 @@ +mod setup; + +use light_client::rpc::Rpc; +use light_program_test::{LightProgramTest, ProgramTestConfig}; +use light_token::instruction::{ + get_associated_token_address, CreateAssociatedTokenAccount, + TransferInterface, LIGHT_TOKEN_PROGRAM_ID, +}; +use solana_sdk::{signature::Keypair, signer::Signer}; + +#[tokio::main] +async fn main() -> Result<(), Box> { + // localnet: + let mut rpc = LightProgramTest::new(ProgramTestConfig::new(true, None)).await?; + // devnet / mainnet: + // use solana_client::rpc_client::RpcClient or light_client::LightClient + + // Top-Up Sponsor: your application server, pays SOL for rent top-ups + let sponsor = rpc.get_payer().insecure_clone(); + + // User: only signs to authorize the transfer + let sender = Keypair::new(); + + let setup::SetupResult { mint, sender_ata } = + setup::setup(&mut rpc, &sponsor, &sender).await?; + + // Create recipient associated token account + let recipient = Keypair::new(); + let recipient_ata = get_associated_token_address(&recipient.pubkey(), &mint); + let create_ata_ix = + CreateAssociatedTokenAccount::new(sponsor.pubkey(), recipient.pubkey(), mint).instruction()?; + rpc.create_and_send_transaction(&[create_ata_ix], &sponsor.pubkey(), &[&sponsor]) + .await?; + + let transfer_ix = TransferInterface { + source: sender_ata, + destination: recipient_ata, + amount: 500_000, + decimals: 6, + mint, + authority: sender.pubkey(), + payer: sponsor.pubkey(), + spl_interface: None, + source_owner: LIGHT_TOKEN_PROGRAM_ID, + destination_owner: LIGHT_TOKEN_PROGRAM_ID, + } + .instruction()?; + + let sig = rpc + .create_and_send_transaction(&[transfer_ix], &sponsor.pubkey(), &[&sponsor, &sender]) + .await?; + + println!("Tx: {sig}"); + + Ok(()) +} diff --git a/toolkits/sponsor-rent-top-ups/typescript/package.json b/toolkits/sponsor-rent-top-ups/typescript/package.json new file mode 100644 index 0000000..c198245 --- /dev/null +++ b/toolkits/sponsor-rent-top-ups/typescript/package.json @@ -0,0 +1,13 @@ +{ + "name": "light-token-toolkit-sponsor-rent-top-ups", + "version": "1.0.0", + "description": "Sponsor rent top-ups for users", + "type": "module", + "scripts": { + "sponsor-top-ups": "tsx sponsor-top-ups.ts" + }, + "dependencies": { + "@lightprotocol/compressed-token": "^0.23.0-beta.9", + "@lightprotocol/stateless.js": "^0.23.0-beta.9" + } +} diff --git a/toolkits/sponsor-rent-top-ups/typescript/setup.ts b/toolkits/sponsor-rent-top-ups/typescript/setup.ts new file mode 100644 index 0000000..f7ca7ea --- /dev/null +++ b/toolkits/sponsor-rent-top-ups/typescript/setup.ts @@ -0,0 +1,43 @@ +// Test setup: creates an SPL mint, funds the sponsor, wraps into Light. +// In production the mint already exists (e.g. USDC) and the sender +// already holds Light tokens. Use wrap.ts to wrap SPL tokens into Light tokens. +// Use unwrap.ts to unwrap Light tokens into SPL tokens. + +import { Keypair } from "@solana/web3.js"; +import { Rpc } from "@lightprotocol/stateless.js"; +import { + createMintInterface, + createAtaInterface, + getAssociatedTokenAddressInterface, +} from "@lightprotocol/compressed-token"; +import { wrap } from "@lightprotocol/compressed-token/unified"; +import { + TOKEN_PROGRAM_ID, + createAssociatedTokenAccount, + mintTo, +} from "@solana/spl-token"; + +export async function setup( + rpc: Rpc, + sponsor: Keypair, + sender: Keypair, +) { + const decimals = 6; + const amount = 1_000_000; + + const { mint } = await createMintInterface( + rpc, sponsor, sponsor, null, decimals, + undefined, undefined, TOKEN_PROGRAM_ID, + ); + + const sponsorSplAta = await createAssociatedTokenAccount( + rpc, sponsor, mint, sponsor.publicKey, undefined, TOKEN_PROGRAM_ID, + ); + await mintTo(rpc, sponsor, mint, sponsorSplAta, sponsor, amount); + + await createAtaInterface(rpc, sponsor, mint, sender.publicKey); + const senderAta = getAssociatedTokenAddressInterface(mint, sender.publicKey); + await wrap(rpc, sponsor, sponsorSplAta, senderAta, sponsor, mint, BigInt(amount)); + + return { mint, senderAta }; +} diff --git a/toolkits/sponsor-rent-top-ups/typescript/sponsor-top-ups.ts b/toolkits/sponsor-rent-top-ups/typescript/sponsor-top-ups.ts new file mode 100644 index 0000000..292f223 --- /dev/null +++ b/toolkits/sponsor-rent-top-ups/typescript/sponsor-top-ups.ts @@ -0,0 +1,46 @@ +import "dotenv/config"; +import { Keypair, Transaction, sendAndConfirmTransaction } from "@solana/web3.js"; +import { createRpc } from "@lightprotocol/stateless.js"; +import { createTransferInterfaceInstructions } from "@lightprotocol/compressed-token/unified"; +import { homedir } from "os"; +import { readFileSync } from "fs"; +import { setup } from "./setup.js"; + +// devnet: +// const RPC_URL = `https://devnet.helius-rpc.com?api-key=${process.env.API_KEY!}`; +// const rpc = createRpc(RPC_URL); +// localnet: +const rpc = createRpc(); + +// Top-Up Sponsor: your application server, pays SOL for rent top-ups +const sponsor = Keypair.fromSecretKey( + new Uint8Array( + JSON.parse(readFileSync(`${homedir()}/.config/solana/id.json`, "utf8")), + ), +); + +// User: only signs to authorize the transfer +const sender = Keypair.generate(); + +(async function () { + const { mint } = await setup(rpc, sponsor, sender); + + const recipient = Keypair.generate(); + + // Loads cold balances, creates recipient ATA if needed. + // Returns TransactionInstruction[][] — each inner array is one transaction. + const instructions = await createTransferInterfaceInstructions( + rpc, + sponsor.publicKey, // payer: sponsor covers rent top-ups + mint, + 500_000, + sender.publicKey, // authority: user signs to authorize transfer + recipient.publicKey, + ); + + for (const ixs of instructions) { + const tx = new Transaction().add(...ixs); + const sig = await sendAndConfirmTransaction(rpc, tx, [sponsor, sender]); + console.log("Tx:", sig); + } +})(); diff --git a/toolkits/sponsor-rent-top-ups/typescript/tsconfig.json b/toolkits/sponsor-rent-top-ups/typescript/tsconfig.json new file mode 100644 index 0000000..de8ab73 --- /dev/null +++ b/toolkits/sponsor-rent-top-ups/typescript/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "target": "ES2020", + "module": "Node16", + "moduleResolution": "Node16", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "outDir": "./dist" + }, + "include": ["**/*.ts"], + "exclude": ["node_modules", "dist"] +} From 5534c0860802f7357b6f9ed554ec253079620a9c Mon Sep 17 00:00:00 2001 From: tilo-14 Date: Fri, 27 Feb 2026 19:32:11 +0000 Subject: [PATCH 2/4] Update CI: sync from escrow-fixes, add sponsor-rent-top-ups check, add docs sync workflow Entire-Checkpoint: 4afa49be1970 --- .github/workflows/rust-tests.yml | 17 +++++++++++++++++ .github/workflows/sync-docs-snippets.yml | 23 +++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 .github/workflows/sync-docs-snippets.yml diff --git a/.github/workflows/rust-tests.yml b/.github/workflows/rust-tests.yml index bb93572..5c3a59a 100644 --- a/.github/workflows/rust-tests.yml +++ b/.github/workflows/rust-tests.yml @@ -84,3 +84,20 @@ jobs: - name: Test working-directory: pinocchio/swap run: cargo test-sbf -p pinocchio-swap -- --test-threads=1 + + check-toolkits: + name: sponsor-rent-top-ups + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup environment + uses: ./.github/actions/setup + with: + example: toolkits/sponsor-rent-top-ups/rust + solana-cli-version: ${{ env.SOLANA_CLI_VERSION }} + rust-toolchain: ${{ env.RUST_TOOLCHAIN }} + + - name: Check + working-directory: toolkits/sponsor-rent-top-ups/rust + run: cargo check diff --git a/.github/workflows/sync-docs-snippets.yml b/.github/workflows/sync-docs-snippets.yml new file mode 100644 index 0000000..e78c360 --- /dev/null +++ b/.github/workflows/sync-docs-snippets.yml @@ -0,0 +1,23 @@ +name: Sync Docs Snippets + +on: + push: + branches: [main] + paths: + - "typescript-client/**" + - "rust-client/**" + - "programs/anchor/basic-instructions/**" + - "programs/anchor/basic-macros/**" + - "toolkits/sponsor-rent-top-ups/**" + +jobs: + dispatch: + runs-on: ubuntu-latest + steps: + - name: Dispatch to docs-v2 + uses: peter-evans/repository-dispatch@v3 + with: + token: ${{ secrets.DOCS_DISPATCH_TOKEN }} + repository: Lightprotocol/docs-v2 + event-type: sync-examples-light-token + client-payload: '{"commit": "${{ github.sha }}"}' From a3689016cf767d91255eb3c8b38a95cc4218d7d7 Mon Sep 17 00:00:00 2001 From: tilo-14 Date: Fri, 27 Feb 2026 19:39:40 +0000 Subject: [PATCH 3/4] Fix READMEs: broken links, missing entries, CLI version consistency Entire-Checkpoint: 4afa49be1970 --- CLAUDE.md | 2 +- README.md | 4 +++- programs/anchor/basic-instructions/README.md | 4 ++-- programs/anchor/basic-macros/README.md | 4 ++-- toolkits/sponsor-rent-top-ups/README.md | 2 +- toolkits/sponsor-rent-top-ups/rust/sponsor-top-ups.rs | 2 +- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 79ec447..3e744f0 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co ## What this repo is -Light Token example programs demonstrating rent-free token vaults using Light Protocol on Solana. Contains Anchor programs (escrow, fundraiser, token-swap, light-token-minter), a shared test utilities crate, TypeScript client examples, and toolkits (payments, streaming). +Light Token example programs demonstrating rent-free token vaults using Light Protocol on Solana. Contains Anchor programs (escrow, fundraiser, token-swap, light-token-minter, pinocchio-swap), a shared test utilities crate, TypeScript and Rust client examples, and toolkits (payments, streaming, sign-with-privy, sponsor-rent-top-ups). ## Build and test diff --git a/README.md b/README.md index b5fc1c2..8d51907 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ Light token is a high-performance token standard that reduces the cost of mint a | [Payments and Wallets](toolkits/payments-and-wallets/) | All you need for wallet integrations and payment flows. Minimal API differences to SPL. | | [Streaming Tokens](toolkits/streaming-tokens/) | Stream mint events using Laserstream | | [Sign with Privy](toolkits/sign-with-privy/) | Light-token operations signed with Privy wallets (Node.js + React) | +| [Sponsor Rent Top-Ups](toolkits/sponsor-rent-top-ups/) | Sponsor rent top-ups for users by setting your application as the fee payer | ## Client Examples @@ -60,8 +61,9 @@ Light token is a high-performance token standard that reduces the cost of mint a | [escrow](programs/anchor/escrow) | Peer-to-peer light-token swap with offer/accept flow | | [fundraiser](programs/anchor/fundraiser) | Token fundraiser with target, deadline, and refunds | | [light-token-minter](programs/anchor/light-token-minter) | Create light-mints with metadata, mint tokens | -| [token-swap](programs/anchor/token-swap) | AMM with liquidity pools and swaps | +| [token-swap](programs/anchor/token-swap) | AMM with liquidity pools and swaps (Anchor) | | [cp-swap-reference](https://github.com/Lightprotocol/cp-swap-reference/tree/954f679699dbdfe9711308c8ae9fbd21e69db8aa) | Fork of Raydium AMM that creates markets without paying rent-exemption | +| [pinocchio-swap](pinocchio/swap) | AMM with liquidity pools and swaps (Pinocchio) | | [create-and-transfer](programs/anchor/create-and-transfer) | Create account via macro and transfer via CPI | ### Macros diff --git a/programs/anchor/basic-instructions/README.md b/programs/anchor/basic-instructions/README.md index 2e12d84..540534a 100644 --- a/programs/anchor/basic-instructions/README.md +++ b/programs/anchor/basic-instructions/README.md @@ -5,7 +5,7 @@ You can replace spl_token with light_token instructions as you need. The API is - **[approve](approve/src/lib.rs)** - Approve delegate - **[burn](burn/src/lib.rs)** - Burn tokens - **[close](close/src/lib.rs)** - Close token account -- **[create-associated-token-account](create-ata/src/lib.rs)** - Create associated light-token account +- **[create-associated-token-account](create-associated-token-account/src/lib.rs)** - Create associated light-token account - **[create-mint](create-mint/src/lib.rs)** - Create light-token mint - **[create-token-account](create-token-account/src/lib.rs)** - Create light-token account - **[freeze](freeze/src/lib.rs)** - Freeze token account @@ -23,7 +23,7 @@ The examples use pure CPI calls which you can combine with existing and / or [li ```bash # for localnet -npm i -g @lightprotocol/zk-compression-cli@alpha +npm i -g @lightprotocol/zk-compression-cli@beta ``` ```bash diff --git a/programs/anchor/basic-macros/README.md b/programs/anchor/basic-macros/README.md index b82b175..df73e26 100644 --- a/programs/anchor/basic-macros/README.md +++ b/programs/anchor/basic-macros/README.md @@ -3,7 +3,7 @@ | | | |---------|--------| | [**counter**](counter) | Create PDA with sponsored rent-exemption | -| [**create-associated-token-account**](create-ata) | Create associated light-token account | +| [**create-associated-token-account**](create-associated-token-account) | Create associated light-token account | | [**create-mint**](create-mint) | Create light-token mint | | [**create-token-account**](create-token-account) | Create light-token account | @@ -17,7 +17,7 @@ For existing programs, you can replace spl_token with light_token instructions a ```bash # for localnet -npm i -g @lightprotocol/zk-compression-cli@alpha +npm i -g @lightprotocol/zk-compression-cli@beta ``` ```bash diff --git a/toolkits/sponsor-rent-top-ups/README.md b/toolkits/sponsor-rent-top-ups/README.md index 689224b..fb6f98f 100644 --- a/toolkits/sponsor-rent-top-ups/README.md +++ b/toolkits/sponsor-rent-top-ups/README.md @@ -3,7 +3,7 @@ Light Token sponsors rent-exemption for Solana accounts and keeps them active through periodic top-ups paid by the fee payer. Set your application as the fee payer to abstract away holding SOL from your users — a rent-free experience similar to transaction fee sponsorship. - **[TypeScript](typescript/)** — Sponsored transfer using `@lightprotocol/compressed-token` -- **[Rust](rust/)** — Sponsored transfer using `light-sdk-client` +- **[Rust](rust/)** — Sponsored transfer using `light-token` Set the `feePayer` field to the public key of the account that will pay the top-ups. Any account that signs the transaction can be the fee payer. diff --git a/toolkits/sponsor-rent-top-ups/rust/sponsor-top-ups.rs b/toolkits/sponsor-rent-top-ups/rust/sponsor-top-ups.rs index 645e176..feebaad 100644 --- a/toolkits/sponsor-rent-top-ups/rust/sponsor-top-ups.rs +++ b/toolkits/sponsor-rent-top-ups/rust/sponsor-top-ups.rs @@ -13,7 +13,7 @@ async fn main() -> Result<(), Box> { // localnet: let mut rpc = LightProgramTest::new(ProgramTestConfig::new(true, None)).await?; // devnet / mainnet: - // use solana_client::rpc_client::RpcClient or light_client::LightClient + // let mut rpc = LightClient::new(LightClientConfig { url: "https://...", .. })?; // Top-Up Sponsor: your application server, pays SOL for rent top-ups let sponsor = rpc.get_payer().insecure_clone(); From 25ccd959ed046b73f9c944154c66ef48b3695aa3 Mon Sep 17 00:00:00 2001 From: tilo-14 Date: Fri, 27 Feb 2026 19:42:27 +0000 Subject: [PATCH 4/4] Add sponsor-rent-top-ups to npm workspaces Entire-Checkpoint: 4afa49be1970 --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 65f79ce..5dd0512 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "toolkits/payments-and-wallets", "toolkits/sign-with-privy/react", "toolkits/sign-with-privy/nodejs", - "toolkits/sign-with-privy/scripts" + "toolkits/sign-with-privy/scripts", + "toolkits/sponsor-rent-top-ups/typescript" ], "scripts": { "toolkit:payments": "npm run -w toolkits/payments-and-wallets"