Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .mintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
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

🧩 Analysis chain

🌐 Web query:

.mintignore file format Mint documentation trailing slash

💡 Result:

Mintlify’s .mintignore is a plain-text file (placed in the root of your docs directory) that uses the same pattern syntax as .gitignore—one pattern per line, # for comments, glob patterns like *.draft.mdx, **/internal/**, and negation with !pattern. [1]

Trailing slash rule: because it follows .gitignore semantics, a pattern ending in / matches directories only (and everything under them). Without the trailing /, the pattern can match both files and directories. Example: drafts/ ignores the drafts directory; drafts could match a file or directory named drafts. [2]


Add trailing slash to match .gitignore conventions.

The .mintignore file uses .gitignore pattern syntax. For directories like node_modules, the trailing slash should be included—change node_modules to node_modules/ to explicitly indicate it's a directory match. This aligns with .gitignore best practices and the existing convention in .mintlifyignore.

🤖 Prompt for AI Agents
In @.mintignore at line 1, Update the `.mintignore` entry for the node_modules
directory to explicitly include a trailing slash: replace the current
"node_modules" pattern with "node_modules/" so the file unambiguously matches a
directory (follow the same convention used in `.mintlifyignore`).

1 change: 1 addition & 0 deletions .mintlifyignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
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

🌐 Web query:

.mintlifyignore file format documentation trailing slash

💡 Result:

Mintlify’s ignore file is .mintignore (not .mintlifyignore). It uses the same pattern syntax as .gitignore. (mintlify.com)

Trailing slash meaning: a pattern ending in / matches a directory (and everything under it). Example from Mintlify’s docs: drafts/ excludes the entire drafts folder. (mintlify.com)

Citations:


🏁 Script executed:

# Check if .mintignore exists in the repository
find . -name ".mintignore" -o -name ".mintlifyignore" | head -20

Repository: Lightprotocol/docs-v2

Length of output: 96


🏁 Script executed:

# Search for any references to mintify or mintignore in the codebase
rg -i "mintify|mintignore" --type json --type md --type txt | head -30

Repository: Lightprotocol/docs-v2

Length of output: 47


🏁 Script executed:

echo "=== .mintignore ===" && cat -n .mintignore && echo -e "\n=== .mintlifyignore ===" && cat -n .mintlifyignore

Repository: Lightprotocol/docs-v2

Length of output: 150


Remove .mintlifyignore — the correct filename for Mintlify is .mintignore.

Mintlify only recognizes .mintignore (not .mintlifyignore). The repository already has .mintignore configured correctly. The .mintlifyignore file will not be used by Mintlify and should be deleted to avoid confusion.

🤖 Prompt for AI Agents
In @.mintlifyignore at line 1, Delete the stray `.mintlifyignore` file—Mintlify
uses `.mintignore` (already present), so remove the unused `.mintlifyignore` to
avoid confusion and duplication in repository configuration.

16 changes: 8 additions & 8 deletions client-library/client-guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ Use the [API documentation](https://lightprotocol.github.io/light-protocol/) to

```bash
npm install --save \
@lightprotocol/stateless.js@beta \
@lightprotocol/compressed-token@beta \
@lightprotocol/stateless.js \
@lightprotocol/compressed-token \
@solana/web3.js
```

Expand All @@ -138,8 +138,8 @@ npm install --save \

```bash
yarn add \
@lightprotocol/stateless.js@beta \
@lightprotocol/compressed-token@beta \
@lightprotocol/stateless.js \
@lightprotocol/compressed-token \
@solana/web3.js
```

Expand All @@ -149,8 +149,8 @@ yarn add \

```bash
pnpm add \
@lightprotocol/stateless.js@beta \
@lightprotocol/compressed-token@beta \
@lightprotocol/stateless.js \
@lightprotocol/compressed-token \
@solana/web3.js
```

Expand Down Expand Up @@ -182,7 +182,7 @@ const rpc = createRpc('https://devnet.helius-rpc.com/?api-key=YOUR_API_KEY');
1. Install the CLI

```bash
npm i -g @lightprotocol/zk-compression-cli@beta
npm i -g @lightprotocol/zk-compression-cli
```

2. Start a local Solana test validator, photon indexer, and prover server on default ports 8899, 8784, and 3001.
Expand Down Expand Up @@ -253,7 +253,7 @@ client.payer = read_keypair_file("~/.config/solana/id.json")?;
1. Install the CLI

```bash
npm i -g @lightprotocol/zk-compression-cli@beta
npm i -g @lightprotocol/zk-compression-cli
```

2. Start a single-node Solana cluster, an RPC node, and a prover node at ports 8899, 8784, and 3001.
Expand Down
4 changes: 3 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@
"offramps",
"zkcompression",
"Tasktool",
"clippy"
"clippy",
"Raydium",
"raydium"
],
"ignorePaths": [
"node_modules",
Expand Down
22 changes: 18 additions & 4 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,39 @@
"pages": [
"light-token/toolkits/overview",
"light-token/toolkits/for-payments",
"light-token/toolkits/for-wallets"
"light-token/toolkits/for-wallets",
"light-token/toolkits/for-streaming-mints",
"light-token/toolkits/for-streaming-tokens"
]
},
{
"group": "Cookbook",
"pages": [
"light-token/cookbook/overview",
{
"group": "Examples",
"expanded": true,
"pages": [
"light-token/examples/client"
]
},
{
"group": "Recipes",
"expanded": true,
"pages": [
"light-token/cookbook/create-mint",
"light-token/cookbook/create-ata",
"light-token/cookbook/create-token-account",
"light-token/cookbook/mint-to",
"light-token/cookbook/close-token-account",
"light-token/cookbook/transfer-interface",
"light-token/cookbook/transfer-checked",
"light-token/cookbook/approve-revoke",
"light-token/cookbook/freeze-thaw",
"light-token/cookbook/wrap-unwrap",
"light-token/cookbook/load-ata"
"light-token/cookbook/load-ata",
"light-token/cookbook/close-token-account",
"light-token/cookbook/burn"

]
}
]
Expand Down Expand Up @@ -254,7 +269,6 @@
"references/whitepaper",
"references/node-operators",
"references/terminology",
"references/light-token-terminology",
"references/migration-v1-to-v2",
"support",
"references/security"
Expand Down
Binary file added init-light.skill
Binary file not shown.
174 changes: 174 additions & 0 deletions light-token/cookbook/approve-revoke.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
---
title: Approve and Revoke Delegates
sidebarTitle: Approve / Revoke
description: Rust client guide to approve and revoke delegates for Light Token accounts. Includes step-by-step implementation and full code examples.
keywords: ["approve delegate solana", "revoke delegate solana", "token delegation"]
---

---

import TokenClientPrerequisites from "/snippets/light-token-guides/light-token-client-prerequisites.mdx";
import FullSetup from "/snippets/setup/full-setup.mdx";
import { CodeCompare } from "/snippets/jsx/code-compare.jsx";
Comment on lines +8 to +12
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

🧩 Analysis chain

🏁 Script executed:

# First, let's locate and examine the file
fd "approve-revoke.mdx" -x cat -n {}

Repository: Lightprotocol/docs-v2

Length of output: 5380


🌐 Web query:

MDX import statements frontmatter horizontal rule syntax

💡 Result:

  • MDX “core” (mdxjs) doesn’t support YAML frontmatter by default. If you want metadata, the built-in/portable approach is ESM exports instead of frontmatter (e.g., export const title = ...). (mdxjs.com)
  • If your toolchain does support YAML frontmatter (via plugins), the delimiter is the same as Markdown frontmatter: a fenced block at the very top of the file using --- lines (this looks like a horizontal rule, but in this position it’s parsed as frontmatter). (github.com)

Import vs frontmatter ordering (common gotcha):

  • In Gatsby (gatsby-plugin-mdx), frontmatter must come first, and import statements go after the frontmatter block. (v3.gatsbyjs.com)

Example (Gatsby-style):

---
title: Hello
date: 2026-02-02
---

import Callout from "../components/Callout.mdx"

# Hello

<Callout />

Citations:


Remove the extraneous horizontal rule before imports.

The file has valid YAML frontmatter (lines 1–6) correctly closed with ---, followed by a blank line. The extra --- on line 8 before imports is invalid—MDX syntax expects imports to come immediately after frontmatter closure, not preceded by another --- delimiter. This stray delimiter can confuse MDX parsers and break document processing.

✅ Proposed fix
---

----
-
 import TokenClientPrerequisites from "/snippets/light-token-guides/light-token-client-prerequisites.mdx";
🤖 Prompt for AI Agents
In `@light-token/cookbook/approve-revoke.mdx` around lines 8 - 12, Remove the
stray YAML delimiter line between the frontmatter and imports by deleting the
extra '---' that appears before the import block; ensure the import statements
(TokenClientPrerequisites, FullSetup, and CodeCompare) come immediately after
the closed frontmatter so the MDX parser sees the imports directly following the
frontmatter closure.

import {
splApproveCode,
lightApproveCode,
splRevokeCode,
lightRevokeCode,
splApproveRustCode,
lightApproveRustCode,
splRevokeRustCode,
lightRevokeRustCode,
} from "/snippets/code-samples/code-compare-snippets.jsx";
import TsApproveActionCode from "/snippets/code-snippets/light-token/approve-revoke/approve-action.mdx";
import TsRevokeActionCode from "/snippets/code-snippets/light-token/approve-revoke/revoke-action.mdx";
import ApproveActionCode from "/snippets/code-snippets/light-token/approve-revoke/rust-client/approve-action.mdx";
import ApproveInstructionCode from "/snippets/code-snippets/light-token/approve-revoke/rust-client/approve-instruction.mdx";
import RevokeActionCode from "/snippets/code-snippets/light-token/approve-revoke/rust-client/revoke-action.mdx";
import RevokeInstructionCode from "/snippets/code-snippets/light-token/approve-revoke/rust-client/revoke-instruction.mdx";
import ApproveAnchorProgramCode from "/snippets/code-snippets/light-token/approve/anchor-program/full-example.mdx";
import RevokeAnchorProgramCode from "/snippets/code-snippets/light-token/revoke/anchor-program/full-example.mdx";

1. Approve grants a delegate permission to transfer up to a specified amount of tokens from your account.
* Each token account can have only one delegate at a time.
* Any new approval overwrites the previous one.
2. Revoke removes all delegate permissions from a Light Token account.
3. Only the token account owner can approve or revoke delegates.

<Tabs>

<Tab title="TypeScript Client">

<Tabs>
<Tab title="Approve">

`approve` grants a delegate permission to transfer up to a specified amount of tokens.

<CodeCompare
firstCode={lightApproveCode}
secondCode={splApproveCode}
firstLabel="light-token"
secondLabel="SPL"
/>

</Tab>
<Tab title="Revoke">

`revoke` removes all delegate permissions from a Light Token account.

<CodeCompare
firstCode={lightRevokeCode}
secondCode={splRevokeCode}
firstLabel="light-token"
secondLabel="SPL"
/>

</Tab>
</Tabs>

<Info>
Find the source code
[here](https://github.com/Lightprotocol/examples-light-token/tree/main/typescript-client/actions).
</Info>

<Steps>
<Step>
### Approve a delegate

<FullSetup />

<TsApproveActionCode />

</Step>

<Step>
### Revoke a delegate

<TsRevokeActionCode />

</Step>
</Steps>

</Tab>

<Tab title="Rust Client">

<Tabs>
<Tab title="Approve">

<CodeCompare
firstCode={lightApproveRustCode}
secondCode={splApproveRustCode}
firstLabel="light-token"
secondLabel="SPL"
language="rust"
/>

</Tab>
<Tab title="Revoke">

<CodeCompare
firstCode={lightRevokeRustCode}
secondCode={splRevokeRustCode}
firstLabel="light-token"
secondLabel="SPL"
language="rust"
/>

</Tab>
</Tabs>

<Steps>
<Step>
### Prerequisites

<TokenClientPrerequisites />

</Step>

<Step>
### Approve or revoke delegates

<Info>
Find the full example including shared test utilities in the
[examples-light-token](https://github.com/Lightprotocol/examples-light-token/tree/main/rust-client).
</Info>

<Tabs>
<Tab title="Approve">
<Tabs>
<Tab title="Action">
<ApproveActionCode />
</Tab>
<Tab title="Instruction">
<ApproveInstructionCode />
</Tab>
</Tabs>
</Tab>
<Tab title="Revoke">
<Tabs>
<Tab title="Action">
<RevokeActionCode />
</Tab>
<Tab title="Instruction">
<RevokeInstructionCode />
</Tab>
</Tabs>
</Tab>
</Tabs>

</Step>
</Steps>
</Tab>

</Tabs>

# Next Steps

<Card
title="Go back to the overview for the Light Token standard"
icon="chevron-right"
color="#0066ff"
href="/light-token/welcome"
horizontal
/>
73 changes: 73 additions & 0 deletions light-token/cookbook/burn.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
title: Burn Light Tokens
sidebarTitle: Burn
description: Rust client guide to burn Light Tokens. Includes step-by-step implementation and full code examples.
keywords: ["burn tokens on solana", "destroy tokens solana", "reduce token supply"]
---

---

import TokenClientPrerequisites from "/snippets/light-token-guides/light-token-client-prerequisites.mdx";
import { CodeCompare } from "/snippets/jsx/code-compare.jsx";
import {
splBurnRustCode,
lightBurnRustCode,
} from "/snippets/code-samples/code-compare-snippets.jsx";
import RustInstructionCode from "/snippets/code-snippets/light-token/burn/rust-client/instruction.mdx";
import BurnCheckedRustInstructionCode from "/snippets/code-snippets/light-token/burn-checked/rust-client/instruction.mdx";



1. Burn permanently destroys tokens by reducing the balance in a token account.
2. Burned tokens are removed from circulation and decreases the supply tracked on the mint account.
3. Only the token account owner (or approved delegate) can burn tokens.

<Tabs>
<Tab title="Rust Client">

Compare to SPL:

<CodeCompare
firstCode={lightBurnRustCode}
secondCode={splBurnRustCode}
firstLabel="light-token"
secondLabel="SPL"
language="rust"
/>

<Steps>
<Step>
### Prerequisites

<TokenClientPrerequisites />

</Step>

<Step>
### Burn Light Tokens

<Info>
Find the full example including shared test utilities in the
[examples-light-token](https://github.com/Lightprotocol/examples-light-token/tree/main/rust-client).
</Info>

<Tabs>
<Tab title="Instruction">
<RustInstructionCode />
</Tab>
</Tabs>
</Step>
</Steps>
</Tab>

</Tabs>

# Next Steps

<Card
title="Learn to freeze and thaw Light Token accounts"
icon="chevron-right"
color="#0066ff"
href="/light-token/cookbook/freeze-thaw"
horizontal
/>
Loading
Loading