Skip to content

chore: update docs to new JS beta#25

Merged
SwenSchaeferjohann merged 6 commits intomainfrom
upd-beta-js
Feb 13, 2026
Merged

chore: update docs to new JS beta#25
SwenSchaeferjohann merged 6 commits intomainfrom
upd-beta-js

Conversation

@SwenSchaeferjohann
Copy link
Contributor

@SwenSchaeferjohann SwenSchaeferjohann commented Feb 13, 2026

Summary by CodeRabbit

  • Documentation

    • Updated source links to main branch, cleaned wording/terminology (token pool → SPL interface / LightTokenProgram) and removed stray blank lines.
  • API Updates

    • Public API names and some signatures renamed to SPL interface / LightTokenProgram variants.
    • Instruction-generation APIs now return arrays of transaction batches to support multi-transaction flows.
  • Code Samples

    • Examples updated to use unified imports, new multi-tx batching patterns, and adjusted parameter names.

@coderabbitai
Copy link

coderabbitai bot commented Feb 13, 2026

Warning

Rate limit exceeded

@SwenSchaeferjohann has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 0 minutes and 18 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Walkthrough

This PR updates docs and examples to reflect an API reshaping: unified compressed-token exports, renamed functions (e.g., createMint→createMintInterface, mintTo→mintToCompressed, createTokenPool→createSplInterface, CompressedTokenProgram→LightTokenProgram), and instruction shapes changing from single TransactionInstruction[] to TransactionInstruction[][] to support multi-transaction batching (load-then-transfer patterns).

Changes

Cohort / File(s) Summary
Cookbook docs
light-token/cookbook/create-ata.mdx, light-token/cookbook/load-ata.mdx, light-token/cookbook/transfer-interface.mdx
Updated source links to main branch; small whitespace/format cleanup and header fixes.
Toolkits (payments & wallets)
light-token/toolkits/for-payments.mdx, light-token/toolkits/for-wallets.mdx
Switched to unified module exports; introduced multi-transaction instruction pattern (functions now return TransactionInstruction[][]), added loadAta/createLoadAtaInstructions, createTransferInterfaceInstructions, sliceLast, and updated examples to iterate/send per instruction chunk.
Code-compare & snippets (transfer)
snippets/code-samples/code-compare-snippets.jsx, snippets/code-samples/code-compare-snippets.ts
Import path updated to @lightprotocol/compressed-token/unified; parameter renamed destinationAtarecipient in example call sites.
Light-token ATA & mint snippets
snippets/code-snippets/light-token/create-ata/instruction.mdx, snippets/code-snippets/light-token/load-ata/*
Replaced CTOKEN_PROGRAM_IDLIGHT_TOKEN_PROGRAM_ID; migrated mint/load helpers to unified API (createMintInterface, mintToCompressed); load examples now handle batched instruction arrays and loop to send per-chunk transactions.
Transfer interface snippets
snippets/code-snippets/light-token/transfer-interface/*
Changed transfer API to accept wallet recipientPublicKey instead of recipientAta; replaced createTransferInterfaceInstruction with createLightTokenTransferInstruction (added explicit amount arg); removed explicit recipient ATA creation at call site.
Unwrap & lifecycle flows
snippets/code-snippets/light-token/unwrap/*
Reworked flows to use interface-backed APIs (createMintInterface, mintToCompressed, createUnwrapInstructions/createLoadAtaInstructions); decimals/mint data via getMint; switched numeric literals to BigInt and send instructions per transaction chunk.
Compressed-token renames & guides
compressed-tokens/... (many *.mdx files), snippets/.../create-token-pool/*
Renamed concept and APIs from “Token Pool”/createTokenPool to “SPL Interface”/createSplInterface; replaced CompressedTokenProgram with LightTokenProgram across docs and snippets; updated terminology, comments, and example headings.
Privy & transfer snippets
assorted snippets/code-snippets/privy/*, snippets/code-snippets/privy/transfer/*
Imports and call sites updated to use LightTokenProgram.* instead of CompressedTokenProgram.*; comments adjusted to SPL interface wording.
Minor edits
assorted snippet and doc files (quickstart, overview tables, terminology, API notes)
Small formatting, link, and comment updates; front-matter whitespace fixes and updated inline comments to reflect new names/terminology.

Sequence Diagram(s)

sequenceDiagram
  participant App as App / Client
  participant Wallet as Wallet (Signer)
  participant RPC as RPC Node
  participant LightProg as LightTokenProgram
  participant SPL as SPL Token Program

  App->>LightProg: createLoadAtaInstructions(...) -> returns TransactionInstruction[][]
  App->>App: sliceLast / partition into load vs transfer chunks
  loop per instruction chunk
    App->>Wallet: request signature for tx built from chunk
    Wallet-->>App: signed transaction
    App->>RPC: sendSignedTransaction(signed tx)
    RPC->>LightProg: deliver instructions
    LightProg->>SPL: call into SPL program as needed
    RPC-->>App: returns tx signature / confirmation
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • chore: refactor airdrop guide #13 — touches compressed-tokens/advanced-guides/airdrop.mdx; related to SPL interface/token-pool rename and doc edits.
  • docs: Add anchor macros #22 — modifies the same light-token cookbook pages (create-ata.mdx, load-ata.mdx, transfer-interface.mdx); overlaps with API/link changes here.

Poem

🐰 From commits old to main I bound and hop,
Unified exports now guide each mint and swap,
Instruction chunks stacked, sent one by one,
Load then transfer — the batched transactions run,
A rabbit’s cheer for docs that never stop! ✨

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore: update docs to new JS beta' accurately summarizes the main change: documentation updates reflecting new JavaScript SDK beta APIs and terminology changes across compressed-token and light-token modules.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch upd-beta-js

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
light-token/toolkits/for-payments.mdx (1)

421-433: ⚠️ Potential issue | 🟠 Major

decimals is used but never declared in the Wrap Instruction example.

Line 429 references decimals, but the code block doesn't show how to obtain it. The Unwrap example (line 499) demonstrates fetching decimals via getMint(...), but the Wrap example is missing this step. Readers copying this snippet will get a ReferenceError.

Suggested fix — add `getMint` usage before the wrap instruction
 import { Transaction } from "@solana/web3.js";
-import { getAssociatedTokenAddressSync } from "@solana/spl-token";
+import { getAssociatedTokenAddressSync, getMint } from "@solana/spl-token";
 import {
   createWrapInstruction,
   getAssociatedTokenAddressInterface,
 } from "@lightprotocol/compressed-token/unified";
 import { getSplInterfaceInfos } from "@lightprotocol/compressed-token";

 const splAta = getAssociatedTokenAddressSync(mint, owner.publicKey);
 const tokenAta = getAssociatedTokenAddressInterface(mint, owner.publicKey);

 const splInterfaceInfos = await getSplInterfaceInfos(rpc, mint);
 const splInterfaceInfo = splInterfaceInfos.find((i) => i.isInitialized);
+const { decimals } = await getMint(rpc, mint, undefined, splInterfaceInfo?.tokenProgram);
snippets/code-snippets/light-token/transfer-interface/action.mdx (1)

5-11: ⚠️ Potential issue | 🟡 Minor

Import path inconsistency: this file uses @lightprotocol/compressed-token while other light-token snippets use @lightprotocol/compressed-token/unified.

This file imports createMintInterface, createAtaInterface, mintToInterface, transferInterface, and getAssociatedTokenAddressInterface from the non-unified path, while load-ata/action.mdx, unwrap/action.mdx, for-wallets.mdx, and for-payments.mdx consistently import from the /unified variant. This inconsistency may confuse readers or indicate a missed update if these symbols have been consolidated under the unified API surface.

🤖 Fix all issues with AI agents
In `@light-token/toolkits/for-payments.mdx`:
- Around line 200-214: The commented-out example after
wallet.signAllTransactions incorrectly shows await
sendAndConfirmTransaction(rpc, tx) without signers; update that line to either
call sendAndConfirmTransaction with the proper signers parameter or, since the
wallet already signed all transactions via wallet.signAllTransactions, use
connection.sendRawTransaction(tx.serialize()) (and optionally await
connection.confirmTransaction) — modify the example near
wallet.signAllTransactions/signed to show one of these correct usages
(reference: wallet.signAllTransactions, sendAndConfirmTransaction,
connection.sendRawTransaction, tx.serialize()).
- Around line 238-249: The sendAndConfirmTransaction calls for the batched load
and the transfer omit the required signers array; update the two calls to
include the signer lists matching the tx.sign calls — for the Promise.all map
where you create tx from loadInstructions and call tx.sign(payer, owner), pass
[payer, owner] into sendAndConfirmTransaction(rpc, tx, [payer, owner]); and for
the transferTx where you call transferTx.sign(payer, owner) (or if only payer
signed, pass [payer] accordingly) call sendAndConfirmTransaction(rpc,
transferTx, [payer, owner]) so the signers argument is provided consistently.

In `@light-token/toolkits/for-wallets.mdx`:
- Around line 147-165: The code block declares const ata twice causing a
copy-paste syntax error; fix it by splitting the examples into two separate
fenced code blocks (one showing getAssociatedTokenAddressSync +
createAssociatedTokenAccountInstruction + Transaction, and a second showing
getOrCreateAssociatedTokenAccount) or by renaming the second variable (e.g.,
ataAccount) and adjusting references; ensure imports are grouped per block so
getAssociatedTokenAddressSync/createAssociatedTokenAccountInstruction are only
in the "Instruction" block and getOrCreateAssociatedTokenAccount is only in the
"Action" block, and keep the variable names consistent with
createAssociatedTokenAccountInstruction, getAssociatedTokenAddressSync,
getOrCreateAssociatedTokenAccount, and Transaction.

In `@snippets/code-snippets/light-token/transfer-interface/action.mdx`:
- Around line 37-38: The amount literal passed to transferInterface should use a
BigInt to match other snippets and the API expectations; change the numeric
literal 500_000_000 to a BigInt (e.g., 500_000_000n or the equivalent scaled
bigint consistent with other examples like 500n/1000n) where
transferInterface(rpc, payer, senderAta, mint, recipient.publicKey, sender,
500_000_000) is called so the last argument is a bigint value and the snippet
style matches load-ata/action.mdx and unwrap/instruction.mdx.

In `@snippets/code-snippets/light-token/unwrap/instruction.mdx`:
- Line 9: The import of bn is unused—remove the unused symbol bn from the import
statement (leave createRpc) so the top-level import becomes only createRpc;
search for any remaining bn(...) usages (e.g., prior pre-BigInt code) and
replace them with BigInt literals (like 500n) if any remain before committing.

Comment on lines 238 to 249
await Promise.all(
loadInstructions.map((ixs) => {
const tx = new Transaction().add(...ixs);
tx.sign(payer, owner);
return sendAndConfirmTransaction(rpc, tx);
})
);

// Send transfer.
const transferTx = new Transaction().add(...transferInstructions);
transferTx.sign(payer, owner);
await sendAndConfirmTransaction(rpc, transferTx);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

sendAndConfirmTransaction calls are missing the signers parameter.

Lines 242 and 249 call sendAndConfirmTransaction(rpc, tx) without a signers array, but the standard @solana/web3.js signature is sendAndConfirmTransaction(connection, transaction, signers). Every other example in this PR passes signers (e.g., [payer, owner] or [payer]). Even though tx.sign(payer, owner) is called beforehand, the function still requires the signers argument.

Suggested fix
     return sendAndConfirmTransaction(rpc, tx);
+    return sendAndConfirmTransaction(rpc, tx, [payer, owner]);
-await sendAndConfirmTransaction(rpc, transferTx);
+await sendAndConfirmTransaction(rpc, transferTx, [payer, owner]);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
await Promise.all(
loadInstructions.map((ixs) => {
const tx = new Transaction().add(...ixs);
tx.sign(payer, owner);
return sendAndConfirmTransaction(rpc, tx);
})
);
// Send transfer.
const transferTx = new Transaction().add(...transferInstructions);
transferTx.sign(payer, owner);
await sendAndConfirmTransaction(rpc, transferTx);
await Promise.all(
loadInstructions.map((ixs) => {
const tx = new Transaction().add(...ixs);
tx.sign(payer, owner);
return sendAndConfirmTransaction(rpc, tx, [payer, owner]);
})
);
// Send transfer.
const transferTx = new Transaction().add(...transferInstructions);
transferTx.sign(payer, owner);
await sendAndConfirmTransaction(rpc, transferTx, [payer, owner]);
🤖 Prompt for AI Agents
In `@light-token/toolkits/for-payments.mdx` around lines 238 - 249, The
sendAndConfirmTransaction calls for the batched load and the transfer omit the
required signers array; update the two calls to include the signer lists
matching the tx.sign calls — for the Promise.all map where you create tx from
loadInstructions and call tx.sign(payer, owner), pass [payer, owner] into
sendAndConfirmTransaction(rpc, tx, [payer, owner]); and for the transferTx where
you call transferTx.sign(payer, owner) (or if only payer signed, pass [payer]
accordingly) call sendAndConfirmTransaction(rpc, transferTx, [payer, owner]) so
the signers argument is provided consistently.

Comment on lines +37 to +38
// destination is a wallet pubkey; the action creates the recipient ATA.
const tx = await transferInterface(rpc, payer, senderAta, mint, recipient.publicKey, sender, 500_000_000);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Amount literal type inconsistency: number (500_000_000) vs BigInt (500n, 1000n) used elsewhere.

Other snippets in this PR use BigInt literals (e.g., 1000n in load-ata/action.mdx line 30, 500n in unwrap/instruction.mdx line 76). This file passes a plain number. If the new API expects bigint, this example will fail at runtime. Even if both are accepted, mixing styles across docs is confusing for readers.

🤖 Prompt for AI Agents
In `@snippets/code-snippets/light-token/transfer-interface/action.mdx` around
lines 37 - 38, The amount literal passed to transferInterface should use a
BigInt to match other snippets and the API expectations; change the numeric
literal 500_000_000 to a BigInt (e.g., 500_000_000n or the equivalent scaled
bigint consistent with other examples like 500n/1000n) where
transferInterface(rpc, payer, senderAta, mint, recipient.publicKey, sender,
500_000_000) is called so the last argument is a bigint value and the snippet
style matches load-ata/action.mdx and unwrap/instruction.mdx.

Transaction,
sendAndConfirmTransaction,
} from "@solana/web3.js";
import { createRpc, bn } from "@lightprotocol/stateless.js";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Unused bn import — leftover from pre-BigInt migration.

bn is imported from @lightprotocol/stateless.js but never used. The amount on line 76 now uses a BigInt literal (500n) instead of bn(500).

Suggested fix
-import { createRpc, bn } from "@lightprotocol/stateless.js";
+import { createRpc } from "@lightprotocol/stateless.js";
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import { createRpc, bn } from "@lightprotocol/stateless.js";
import { createRpc } from "@lightprotocol/stateless.js";
🤖 Prompt for AI Agents
In `@snippets/code-snippets/light-token/unwrap/instruction.mdx` at line 9, The
import of bn is unused—remove the unused symbol bn from the import statement
(leave createRpc) so the top-level import becomes only createRpc; search for any
remaining bn(...) usages (e.g., prior pre-BigInt code) and replace them with
BigInt literals (like 500n) if any remain before committing.

Find a full code example [here](https://github.com/Lightprotocol/examples-light-token/blob/main/toolkits/payments-and-wallets/send-and-receive.ts).
</Note>

Load creates the ATA if needed and pulls any cold state to hot. Share the ATA address with the sender.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Load creates the ATA if needed and pulls any cold state to hot. Share the ATA address with the sender.
Load creates the associated token account for the recipient <Tooltip tip="Inactive Light Tokens are cryptographically preserved on the Solana ledger as compressed tokens (cold storage) and are automatically loaded with this instruction to an associated token account.">if needed</Tooltip> and unifies the token balance of cold (compressed) Light Tokens in an associated token account. Share the associated token account address with the sender.

Find a full code example [here](https://github.com/Lightprotocol/examples-light-token/blob/main/toolkits/payments-and-wallets/send-and-receive.ts).
</Note>

Load creates the ATA if needed and pulls any cold state to hot. Share the ATA address with the sender.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Load creates the ATA if needed and pulls any cold state to hot. Share the ATA address with the sender.
Load creates the associated token account for the recipient <Tooltip tip="Inactive Light Tokens are cryptographically preserved on the Solana ledger as compressed tokens (cold storage) and are automatically loaded with this instruction to an associated token account.">if needed</Tooltip> and unifies the token balance of cold (compressed) Light Tokens in an associated token account. Share the associated token account address with the sender.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
compressed-tokens/advanced-guides/use-token-2022-with-compression.mdx (1)

42-44: ⚠️ Potential issue | 🟡 Minor

Consider updating minimum SDK version requirements.

The prerequisite versions still reference ≥ 0.21.0, but if createSplInterface (replacing createTokenPool) is introduced in a newer version, these minimums should be bumped to match the release that includes the renamed API.

compressed-tokens/advanced-guides/how-to-combine-operations-in-one-transaction.mdx (1)

162-162: ⚠️ Potential issue | 🟡 Minor

Stale terminology: "Token pool created" not updated.

Line 162 still says "Token pool created and tokens compressed" — should be updated to reference "SPL interface" for consistency with the rest of the guide.

Suggested fix
-    console.log("Token pool created and tokens compressed");
+    console.log("SPL interface created and tokens compressed");
🤖 Fix all issues with AI agents
In `@compressed-tokens/for-privy.mdx`:
- Line 99: Fix the grammar in the sentence within
compressed-tokens/for-privy.mdx: change the phrase "a interface PDA for
compression" to "an interface PDA for compression" (locate the exact sentence
starting "* An SPL mint with a interface PDA for compression..." and update "a"
to "an").

In `@compressed-tokens/guides/add-token-pools-to-mint-accounts.mdx`:
- Line 28: The text references a non-existent function addTokenPools(); update
the documentation to use the correct API function createSplInterface()
instead—replace addTokenPools() with createSplInterface() in the sentence about
creating additional interfaces and increasing per-block write-lock capacity so
it matches actual usage and other examples.
🧹 Nitpick comments (3)
snippets/overview-tables/compressed-tokens-guides-table.mdx (1)

8-9: Table content updated correctly; URL slugs still reference old terminology.

The display text and descriptions are properly updated to "SPL interface" / "SPL Interface PDA", but the link slugs (create-mint-with-token-pool, add-token-pools-to-mint-accounts) still use the old "token pool" naming. This is fine to avoid breaking existing bookmarks/external links, but consider adding redirects or updating slugs in a follow-up if you want full consistency.

compressed-tokens/guides/add-token-pools-to-mint-accounts.mdx (1)

17-17: Stale code block filename: function-create-token-pool.ts.

The code block title still references "token-pool" terminology. Consider renaming to something like function-create-spl-interface.ts for consistency with the SPL interface rename.

Suggested rename
-```typescript function-create-token-pool.ts
+```typescript function-create-spl-interface.ts
compressed-tokens/advanced-guides/airdrop.mdx (1)

768-768: Minor: parenthetical (SPL interface infos) in comment could be clearer.

The comment on line 768 reads getTokenPoolInfos() (SPL interface infos) — the parenthetical clarification is helpful but slightly awkward alongside the un-renamed function name. This is a minor style nit.

Before we call compress or decompresss, we need:

* An SPL mint with a interface PDA for compression. This PDA can be created for new SPL mints via [`createMint()`](/compressed-tokens/guides/create-mint-with-token-pool) or added to existing SPL mints via [`createTokenPool()`](/compressed-tokens/guides/add-token-pools-to-mint-accounts).
* An SPL mint with a interface PDA for compression. This PDA can be created for new SPL mints via [`createMint()`](/compressed-tokens/guides/create-mint-with-token-pool) or added to existing SPL mints via [`createSplInterface()`](/compressed-tokens/guides/add-token-pools-to-mint-accounts).
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Grammar: "a interface" → "an interface"

📝 Proposed fix
-* An SPL mint with a interface PDA for compression. This PDA can be created for new SPL mints via [`createMint()`](/compressed-tokens/guides/create-mint-with-token-pool) or added to existing SPL mints via [`createSplInterface()`](/compressed-tokens/guides/add-token-pools-to-mint-accounts).
+* An SPL mint with an interface PDA for compression. This PDA can be created for new SPL mints via [`createMint()`](/compressed-tokens/guides/create-mint-with-token-pool) or added to existing SPL mints via [`createSplInterface()`](/compressed-tokens/guides/add-token-pools-to-mint-accounts).
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
* An SPL mint with a interface PDA for compression. This PDA can be created for new SPL mints via [`createMint()`](/compressed-tokens/guides/create-mint-with-token-pool) or added to existing SPL mints via [`createSplInterface()`](/compressed-tokens/guides/add-token-pools-to-mint-accounts).
* An SPL mint with an interface PDA for compression. This PDA can be created for new SPL mints via [`createMint()`](/compressed-tokens/guides/create-mint-with-token-pool) or added to existing SPL mints via [`createSplInterface()`](/compressed-tokens/guides/add-token-pools-to-mint-accounts).
🤖 Prompt for AI Agents
In `@compressed-tokens/for-privy.mdx` at line 99, Fix the grammar in the sentence
within compressed-tokens/for-privy.mdx: change the phrase "a interface PDA for
compression" to "an interface PDA for compression" (locate the exact sentence
starting "* An SPL mint with a interface PDA for compression..." and update "a"
to "an").


<Check>
**Best Practice:** Each mint supports a maximum of 4 token pools total. During compression/decompression operations, token pools get write-locked. Use `addTokenPools()` to create additional pools that increase per-block write-lock capacity.
**Best Practice:** Each mint supports up to 4 SPL interfaces. During compression/decompression, SPL Interface PDAs get write-locked. Use `addTokenPools()` to create additional interfaces and increase per-block write-lock capacity.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# First, find and examine the file at the specified location
echo "=== Examining the file ==="
fd "add-token-pools-to-mint-accounts.mdx" -x cat -n {}

echo ""
echo "=== Searching for addTokenPools in the codebase ==="
rg "addTokenPools" -n --type-add 'md:*.mdx' --type md

echo ""
echo "=== Searching for any SPL interface function names ==="
rg "addSplInterface|createSplInterface" -n --type-add 'md:*.mdx' --type md

Repository: Lightprotocol/docs-v2

Length of output: 9305


🏁 Script executed:

#!/bin/bash
# Search for function definitions and exports of both functions
echo "=== Searching for addTokenPools function definition ==="
rg "addTokenPools" -n -A 5 -B 2

echo ""
echo "=== Checking TypeScript/JavaScript files for exports ==="
fd "\.(ts|js|tsx|jsx)$" -x grep -l "addTokenPools\|export.*createSplInterface" {}

echo ""
echo "=== Looking for package.json or SDK type definitions ==="
fd "package.json|index.ts|index.d.ts" -x grep -l "addTokenPools\|createSplInterface" {}

Repository: Lightprotocol/docs-v2

Length of output: 1783


Replace addTokenPools() with createSplInterface()—the function does not exist.

The function addTokenPools() does not exist anywhere in the codebase. All examples and actual API usage reference createSplInterface(). Update line 28 to use the correct function name.

🤖 Prompt for AI Agents
In `@compressed-tokens/guides/add-token-pools-to-mint-accounts.mdx` at line 28,
The text references a non-existent function addTokenPools(); update the
documentation to use the correct API function createSplInterface()
instead—replace addTokenPools() with createSplInterface() in the sentence about
creating additional interfaces and increasing per-block write-lock capacity so
it matches actual usage and other examples.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
compressed-tokens/advanced-guides/add-wallet-support-for-compressed-tokens.mdx (1)

286-296: ⚠️ Potential issue | 🔴 Critical

Update imports and function names to match the current API: createMintcreateMintInterface, mintTomintToCompressed.

The imports at line 289 use outdated function names. Throughout the codebase, all other code snippets use createMintInterface and mintToCompressed from @lightprotocol/compressed-token. Line 311 and 322 which call createMint() and mintTo() also need to be updated to use the new function names.

compressed-tokens/advanced-guides/airdrop.mdx (1)

291-292: ⚠️ Potential issue | 🔴 Critical

Update imports to use the new compressed-token API names.

The file imports createMint from @lightprotocol/compressed-token, but this export has been renamed to createMintInterface. Additionally, mintTo should be mintToCompressed. Other sections of the documentation (light-token snippets) already use the new names, confirming this is the current API.

References to updated names in codebase

Multiple files import the new names:

  • snippets/code-snippets/light-token/create-spl-mint/action.mdx: createMintInterface
  • snippets/code-snippets/light-token/unwrap/instruction.mdx: createMintInterface, mintToCompressed
  • snippets/code-snippets/light-token/load-ata/instruction.mdx: createMintInterface, mintToCompressed
snippets/code-snippets/light-token/create-token-pool/instruction.mdx (1)

30-36: ⚠️ Potential issue | 🔴 Critical

Replace LightTokenProgram.createSplInterface() with the correct API: CompressedTokenProgram.createTokenPool().

LightTokenProgram and createSplInterface do not exist in @lightprotocol/compressed-token. The correct import and method are:

import { CompressedTokenProgram } from "@lightprotocol/compressed-token";

const ix = await CompressedTokenProgram.createTokenPool({
    feePayer: payer.publicKey,
    mint: existingMint,
    tokenProgramId: TOKEN_PROGRAM_ID,
});

const tx = new Transaction().add(ix);

The createTokenPool() method returns a single TransactionInstruction, which is fully compatible with Transaction.add().

🤖 Fix all issues with AI agents
In
`@compressed-tokens/advanced-guides/add-wallet-support-for-compressed-tokens.mdx`:
- Line 457: The backticks around method references include trailing punctuation,
making them render like chained property access; update occurrences of
`LightTokenProgram.decompress().` and `LightTokenProgram.compress().` so the
trailing period is outside the backticks (e.g.,
`LightTokenProgram.decompress()`.). Locate the two instances (one at the example
that says "This example converts compressed tokens..." and the other on the line
that references compress) and move the period outside the inline code span for
correct rendering.
- Line 481: The createRpc call for the connection contains a stray semicolon
inside the parentheses causing a syntax error; update the Rpc initialization
(variable connection and the createRpc(...) invocation) to remove the extra
semicolon so the string argument ends with the closing quote and then the
closing parenthesis — ensure
createRpc("https://mainnet.helius-rpc.com?api-key=<api_key>") is used (keeping
the API key placeholder intact).

In `@light-token/toolkits/for-payments.mdx`:
- Around line 224-242: The code block declares const ata twice (using
getAssociatedTokenAddressSync and then getOrCreateAssociatedTokenAccount) which
will cause a duplicate-declaration error; fix by splitting the examples into two
separate fenced code blocks (one showing the "Instruction" example using
getAssociatedTokenAddressSync and createAssociatedTokenAccountInstruction with
variable ata1 or just its own block) and a second fenced block for the "Action"
example using getOrCreateAssociatedTokenAccount (or rename the second variable
to ataAccount/ata2) so getAssociatedTokenAddressSync,
createAssociatedTokenAccountInstruction, Transaction, and
getOrCreateAssociatedTokenAccount examples do not reuse the same const name in
the same scope.

In `@light-token/toolkits/for-wallets.mdx`:
- Around line 71-72: The documentation lists assumed variables (rpc, payer,
mint, owner, recipient, amount) but uses decimals in the "Wrap" snippet; update
the examples to either add decimals to the assumed-variables list or modify the
Wrap code to derive decimals at runtime (for example call getMint(rpc, mint) and
read mintInfo.decimals) and update the same omission in the for-payments.mdx
file; adjust any references in the Wrap snippet to use the derived decimals
variable (or the newly documented assumed variable) so the snippet is
self-contained and consistent.
- Around line 111-132: The code uses sendAndConfirmTransaction but only imports
Transaction; update the import list from "@solana/web3.js" to include
sendAndConfirmTransaction (or consolidate imports so both Transaction and
sendAndConfirmTransaction are imported together) so the
createLoadAtaInstructions usage and subsequent send loop works; apply the same
fix to the other examples (Send Payments and Unwrap) that call
sendAndConfirmTransaction to make each snippet self-contained and
copy-pasteable.

<Accordion title="Decompress to Regular SPL">

This example converts compressed tokens to regular SPL format using `CompressedTokenProgram.decompress().`
This example converts compressed tokens to regular SPL format using `LightTokenProgram.decompress().`
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Punctuation inside backtick makes method reference look like a chained property access.

The trailing period is inside the backtick: `LightTokenProgram.decompress().` which renders as a property access. Move the period outside.

Same issue on line 543 with `LightTokenProgram.compress().`.

Proposed fix
-This example converts compressed tokens to regular SPL format using `LightTokenProgram.decompress().`
+This example converts compressed tokens to regular SPL format using `LightTokenProgram.decompress()`.

Line 543:

-This example converts regular SPL tokens to compressed format using `LightTokenProgram.compress().`
+This example converts regular SPL tokens to compressed format using `LightTokenProgram.compress()`.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
This example converts compressed tokens to regular SPL format using `LightTokenProgram.decompress().`
This example converts compressed tokens to regular SPL format using `LightTokenProgram.decompress()`.
🤖 Prompt for AI Agents
In
`@compressed-tokens/advanced-guides/add-wallet-support-for-compressed-tokens.mdx`
at line 457, The backticks around method references include trailing
punctuation, making them render like chained property access; update occurrences
of `LightTokenProgram.decompress().` and `LightTokenProgram.compress().` so the
trailing period is outside the backticks (e.g.,
`LightTokenProgram.decompress()`.). Locate the two instances (one at the example
that says "This example converts compressed tokens..." and the other on the line
that references compress) and move the period outside the inline code span for
correct rendering.

// 3. Create decompress instruction with LightTokenProgram.decompress() and submit transaction

// Step 1: Setup RPC connection and define decompression parameters
const connection: Rpc = createRpc("https://mainnet.helius-rpc.com?api-key=<api_key>";);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Pre-existing syntax error: stray semicolon inside createRpc() call.

createRpc("https://mainnet.helius-rpc.com?api-key=<api_key>";);

The ; between the closing quote and ) is invalid JavaScript. Users copying this snippet will get a syntax error.

Proposed fix
-const connection: Rpc = createRpc("https://mainnet.helius-rpc.com?api-key=<api_key>";);
+const connection: Rpc = createRpc("https://mainnet.helius-rpc.com?api-key=<api_key>");
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const connection: Rpc = createRpc("https://mainnet.helius-rpc.com?api-key=<api_key>";);
const connection: Rpc = createRpc("https://mainnet.helius-rpc.com?api-key=<api_key>");
🤖 Prompt for AI Agents
In
`@compressed-tokens/advanced-guides/add-wallet-support-for-compressed-tokens.mdx`
at line 481, The createRpc call for the connection contains a stray semicolon
inside the parentheses causing a syntax error; update the Rpc initialization
(variable connection and the createRpc(...) invocation) to remove the extra
semicolon so the string argument ends with the closing quote and then the
closing parenthesis — ensure
createRpc("https://mainnet.helius-rpc.com?api-key=<api_key>") is used (keeping
the API key placeholder intact).

Comment on lines 224 to 242
```typescript
import {
createAssociatedTokenAccountInstruction,
getAssociatedTokenAddressSync,
createTransferInstruction,
getOrCreateAssociatedTokenAccount,
} from "@solana/spl-token";

const sourceAta = getAssociatedTokenAddressSync(mint, owner.publicKey);
const destinationAta = getAssociatedTokenAddressSync(mint, recipient);
const ata = getAssociatedTokenAddressSync(mint, recipient);

// Instruction:
const tx = new Transaction().add(
createTransferInstruction(sourceAta, destinationAta, owner.publicKey, amount)
createAssociatedTokenAccountInstruction(payer.publicKey, ata, recipient, mint)
);

// Action:
const ata = await getOrCreateAssociatedTokenAccount(
connection, payer, mint, recipient
);
```
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Duplicate const ata declaration in the same code block.

Lines 231 and 239 both declare const ata within a single code fence. A reader copying this block would get a syntax error. Split into two separate code blocks (one for instruction, one for action) or use different variable names.

 const ata = getAssociatedTokenAddressSync(mint, recipient);
 
 // Instruction:
 const tx = new Transaction().add(
   createAssociatedTokenAccountInstruction(payer.publicKey, ata, recipient, mint)
 );
 
 // Action:
-const ata = await getOrCreateAssociatedTokenAccount(
+const ataAccount = await getOrCreateAssociatedTokenAccount(
   connection, payer, mint, recipient
 );
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
```typescript
import {
createAssociatedTokenAccountInstruction,
getAssociatedTokenAddressSync,
createTransferInstruction,
getOrCreateAssociatedTokenAccount,
} from "@solana/spl-token";
const sourceAta = getAssociatedTokenAddressSync(mint, owner.publicKey);
const destinationAta = getAssociatedTokenAddressSync(mint, recipient);
const ata = getAssociatedTokenAddressSync(mint, recipient);
// Instruction:
const tx = new Transaction().add(
createTransferInstruction(sourceAta, destinationAta, owner.publicKey, amount)
createAssociatedTokenAccountInstruction(payer.publicKey, ata, recipient, mint)
);
// Action:
const ata = await getOrCreateAssociatedTokenAccount(
connection, payer, mint, recipient
);
```
🤖 Prompt for AI Agents
In `@light-token/toolkits/for-payments.mdx` around lines 224 - 242, The code block
declares const ata twice (using getAssociatedTokenAddressSync and then
getOrCreateAssociatedTokenAccount) which will cause a duplicate-declaration
error; fix by splitting the examples into two separate fenced code blocks (one
showing the "Instruction" example using getAssociatedTokenAddressSync and
createAssociatedTokenAccountInstruction with variable ata1 or just its own
block) and a second fenced block for the "Action" example using
getOrCreateAssociatedTokenAccount (or rename the second variable to
ataAccount/ata2) so getAssociatedTokenAddressSync,
createAssociatedTokenAccountInstruction, Transaction, and
getOrCreateAssociatedTokenAccount examples do not reuse the same const name in
the same scope.

Comment on lines +71 to +72
Snippets below assume `rpc`, `payer`, `mint`, `owner`, `recipient`, and `amount` are defined.
See the [full examples](https://github.com/Lightprotocol/examples-light-token/tree/main/toolkits/payments-and-wallets) for runnable setup.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

decimals is not listed among assumed variables but is used in the Wrap section.

Line 71 lists rpc, payer, mint, owner, recipient, and amount as assumed variables, but the Wrap instruction code block (line 352) also uses decimals. Either add decimals to this list or derive it in the wrap snippet (e.g., from getMint).

The same omission exists in for-payments.mdx (line 71 and line 474).

🤖 Prompt for AI Agents
In `@light-token/toolkits/for-wallets.mdx` around lines 71 - 72, The documentation
lists assumed variables (rpc, payer, mint, owner, recipient, amount) but uses
decimals in the "Wrap" snippet; update the examples to either add decimals to
the assumed-variables list or modify the Wrap code to derive decimals at runtime
(for example call getMint(rpc, mint) and read mintInfo.decimals) and update the
same omission in the for-payments.mdx file; adjust any references in the Wrap
snippet to use the derived decimals variable (or the newly documented assumed
variable) so the snippet is self-contained and consistent.

Comment on lines 111 to 132
```typescript
import { Transaction } from "@solana/web3.js";
import {
createAssociatedTokenAccountInterfaceIdempotentInstruction,
createLoadAtaInstructions,
getAssociatedTokenAddressInterface,
} from "@lightprotocol/compressed-token";
import { LIGHT_TOKEN_PROGRAM_ID } from "@lightprotocol/stateless.js";
} from "@lightprotocol/compressed-token/unified";

const ata = getAssociatedTokenAddressInterface(mint, recipient);

const tx = new Transaction().add(
createAssociatedTokenAccountInterfaceIdempotentInstruction(
payer.publicKey,
ata,
recipient,
mint,
LIGHT_TOKEN_PROGRAM_ID
),
...(await createLoadAtaInstructions(
rpc,
ata,
recipient,
mint,
payer.publicKey
))
// Each inner array = one transaction. Usually just one. Empty = nothing to load.
const instructions = await createLoadAtaInstructions(
rpc,
ata,
recipient,
mint,
payer.publicKey
);

for (const ixs of instructions) {
const tx = new Transaction().add(...ixs);
await sendAndConfirmTransaction(rpc, tx, [payer]);
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

sendAndConfirmTransaction used but not imported in this code block.

Line 131 calls sendAndConfirmTransaction but only Transaction is imported on line 112. The same omission occurs in the Send Payments (line 202) and Unwrap (line 408) instruction blocks. For-payments.mdx is more consistent, importing it in most instruction blocks (e.g., lines 120, 256, 512).

Add the import for self-contained, copy-pasteable snippets:

 import { Transaction } from "@solana/web3.js";
+import { sendAndConfirmTransaction } from "@solana/web3.js";

Or combine:

-import { Transaction } from "@solana/web3.js";
+import { Transaction, sendAndConfirmTransaction } from "@solana/web3.js";
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
```typescript
import { Transaction } from "@solana/web3.js";
import {
createAssociatedTokenAccountInterfaceIdempotentInstruction,
createLoadAtaInstructions,
getAssociatedTokenAddressInterface,
} from "@lightprotocol/compressed-token";
import { LIGHT_TOKEN_PROGRAM_ID } from "@lightprotocol/stateless.js";
} from "@lightprotocol/compressed-token/unified";
const ata = getAssociatedTokenAddressInterface(mint, recipient);
const tx = new Transaction().add(
createAssociatedTokenAccountInterfaceIdempotentInstruction(
payer.publicKey,
ata,
recipient,
mint,
LIGHT_TOKEN_PROGRAM_ID
),
...(await createLoadAtaInstructions(
rpc,
ata,
recipient,
mint,
payer.publicKey
))
// Each inner array = one transaction. Usually just one. Empty = nothing to load.
const instructions = await createLoadAtaInstructions(
rpc,
ata,
recipient,
mint,
payer.publicKey
);
for (const ixs of instructions) {
const tx = new Transaction().add(...ixs);
await sendAndConfirmTransaction(rpc, tx, [payer]);
}
🤖 Prompt for AI Agents
In `@light-token/toolkits/for-wallets.mdx` around lines 111 - 132, The code uses
sendAndConfirmTransaction but only imports Transaction; update the import list
from "@solana/web3.js" to include sendAndConfirmTransaction (or consolidate
imports so both Transaction and sendAndConfirmTransaction are imported together)
so the createLoadAtaInstructions usage and subsequent send loop works; apply the
same fix to the other examples (Send Payments and Unwrap) that call
sendAndConfirmTransaction to make each snippet self-contained and
copy-pasteable.

@SwenSchaeferjohann SwenSchaeferjohann merged commit 07ed0e3 into main Feb 13, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants