generated from mintlify/starter
-
Notifications
You must be signed in to change notification settings - Fork 1
Reorganize docs navigation and home page #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tilo-14
wants to merge
46
commits into
main
Choose a base branch
from
docs-main-reorder
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
0cc1042
Reorganize docs: restructure navigation, add AI prompts, update examp…
7a3189d
Implement the following plan:
b055d4c
Try it. but not all 6 I think the with metadata we can delete anyhow
c9e1416
Implement the following plan:
4925474
Put back into the accordions. but dont revert change, modify
ec68f19
Put anchor macro as 3rd
5ab8aa3
And name it macro not macros
969dab2
WELL NOT THOS Light-PDA
953ac45
refactor ai prompts
5ccfd36
refactor ai prompts
d06f4f4
unify temrinology
d2527f2
tab names
SwenSchaeferjohann bb4edaf
Implement the following plan:
d3cd43b
Mv rent sponsorship mdx to introduction
4195739
Below faa
36dba71
Index this file. and then we need to make the table left bound
1ccba51
Ata -> associated token account
c7ee616
The Light Token Program pays the rent-exemption cost for the account.
c047b6e
<CompressibleRentExplained />
bebfbcb
A rent sponsor PDA by light protocl
ed2468d
All ata
ed06bf8
Line 56
c3d4489
Completed 'Explore' agent: Explore examples-light-token repo (toolu_0…
33ae407
Ahh ok. then it's fine . let's add the instruction snippet we have -> up
e376e24
And rm the other tabs
9d54323
Add below like in the payments toolkit the one time setup
6598d69
Do the setup in the accordion
abb2fcf
Other thing . wrap in this mdx into an accordion this section
a3b7219
Something breaks the page if we do it like this. where is a thing not fo
adbc9a1
Move the rent sponsorship page to For Payments section
fe086e4
Move it to toolkits as well
313bc08
Rent-exemption: sponsored by a rent sponsor PDA.
e8c78eb
Make this into an accordion
f2330dc
Move below wallets sign with privy
d192397
Base directory for this skill: /home/tilo/.claude/skills/workflow-auto
f0975de
Completed 'Explore' agent: Explore examples-light-token structure (to…
463cb10
Completed 'Explore' agent: Find Rust API for sponsored transfer (tool…
53e226a
Or let's clone and leave the general snippet untouched? like in the exam
d2897fd
IMPORTANT - Autonomous Execution Mode
9be1a0e
Put the setup to a separate file then, so it is labeled as setup
2d39cf2
Good start. now, let's rm all long dashes -
0496c5f
1 to 1 align
01c1a42
Add in line 24 at theend
7e5653b
Wait. not fee sponsorship. we are sponsoring rent-top ips here
fe1dbb6
Rename rent-sponsorship -> sponsor-top ups and fix all associated links
ff2d97b
Sponsor rent top-ups to abstract away holding SOL and provide a rent-fre
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
Submodule program-examples
deleted from
bf2705
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| tmp/ | ||
| settings.local.json | ||
| metadata/ | ||
| logs/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "strategy": "auto-commit", | ||
| "enabled": true, | ||
| "telemetry": false | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,4 +9,7 @@ node_modules/ | |
|
|
||
| stash | ||
| docs-audit.md | ||
| docs-audit.txt | ||
| docs-audit.txt | ||
| docs-anchor.json | ||
| product-docs.json | ||
| tabs-docs.json | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| title: "AI Prompts" | ||
| description: "Ready-to-use AI prompts for Light Protocol. Copy a prompt, paste into your AI coding agent, and let it implement the recipe in your project." | ||
| --- | ||
|
|
||
| import AllPrompts from "/snippets/ai-prompts/all-prompts.mdx"; | ||
|
|
||
| <AllPrompts /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,194 @@ | ||
| --- | ||
| title: "Anchor Constraints LightAccount" | ||
| description: "Syntax reference for #[light_account] constraints with sponsored rent-exemption." | ||
| --- | ||
|
|
||
| - [`#[light_account(init)]`](#light_accountinit) creates a PDA | ||
| - [`#[light_account(init, token::...)]`](#light_accountinit-token) creates a token account via CPI | ||
| - [`#[light_account(init, associated_token::...)]`](#light_accountinit-associated_token) creates an ATA via CPI | ||
| - [`#[light_account(init, mint::...)]`](#light_accountinit-mint) creates a mint via CPI | ||
| - [Required accounts](#required-accounts) per account type | ||
|
|
||
| Place `#[light_account]` below standard Anchor `#[account]` on the same field. | ||
| Anchor handles seeds, space, and payer; LightAccount handles rent-free creation. | ||
|
|
||
| --- | ||
|
|
||
| ### `#[light_account(init)]` | ||
|
|
||
| Creates a rent-free PDA. No additional parameters — uses Anchor `#[account]` seeds and space. | ||
|
|
||
| **attribute** | ||
|
|
||
| ``` | ||
| #[light_account(init)] | ||
| ``` | ||
|
|
||
| ```rust | ||
| #[account( // ← Anchor: seeds, space, payer | ||
| init, | ||
| payer = fee_payer, | ||
| space = 8 + <Counter as anchor_lang::Space>::INIT_SPACE, | ||
| seeds = [COUNTER_SEED, owner.key().as_ref()], | ||
| bump, | ||
| )] | ||
| #[light_account(init)] // ← Light: register for rent-free creation | ||
| pub counter: Account<'info, Counter>, | ||
| ``` | ||
|
|
||
| Examples: [Github](https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-macros/counter) | ||
|
|
||
| --- | ||
|
|
||
| ### `#[light_account(init, token::...)]` | ||
|
|
||
| Creates a rent-free token account via CPI to the Light Token program. The account type is `UncheckedAccount` because Light Token program initializes it via CPI. | ||
|
|
||
| **attribute** | ||
|
|
||
| ``` | ||
| #[light_account(init, | ||
| token::authority = <seeds>, | ||
| token::mint = <account>, | ||
| token::owner = <account>, | ||
| token::bump = <expr> | ||
| )] | ||
| ``` | ||
|
|
||
| ```rust | ||
| #[account( | ||
| mut, | ||
| seeds = [VAULT_SEED, mint.key().as_ref()], | ||
| bump, | ||
| )] | ||
| #[light_account(init, | ||
| token::authority = [VAULT_SEED, self.mint.key()], | ||
| token::mint = mint, | ||
| token::owner = vault_authority, | ||
| token::bump = params.vault_bump | ||
| )] | ||
| pub vault: UncheckedAccount<'info>, | ||
| ``` | ||
|
|
||
| Examples: [Github](https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-macros/create-token-account) | ||
|
|
||
| --- | ||
|
|
||
| ### `#[light_account(init, associated_token::...)]` | ||
|
|
||
| Creates a rent-free associated token account via CPI. | ||
|
|
||
| **attribute** | ||
|
|
||
| ``` | ||
| #[light_account(init, | ||
| associated_token::authority = <account>, | ||
| associated_token::mint = <account>, | ||
| associated_token::bump = <expr> | ||
| )] | ||
| ``` | ||
|
|
||
| ```rust | ||
| #[account(mut)] | ||
| #[light_account(init, | ||
| associated_token::authority = associated_token_account_owner, | ||
| associated_token::mint = associated_token_account_mint, | ||
| associated_token::bump = params.associated_token_account_bump | ||
| )] | ||
| pub associated_token_account: UncheckedAccount<'info>, | ||
| ``` | ||
|
|
||
| Examples: [Github](https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-macros/create-associated-token-account) | ||
|
|
||
| --- | ||
|
|
||
| ### `#[light_account(init, mint::...)]` | ||
|
|
||
| Creates a rent-free mint via CPI. | ||
|
|
||
| **attribute (required)** | ||
|
|
||
| ``` | ||
| #[light_account(init, mint, | ||
| mint::signer = <account>, | ||
| mint::authority = <account>, | ||
| mint::decimals = <expr>, | ||
| mint::seeds = <seeds>, | ||
| )] | ||
| ``` | ||
|
|
||
| **attribute (optional)** | ||
|
|
||
| ``` | ||
| mint::bump = <expr> | ||
| mint::freeze_authority = <ident> | ||
| mint::authority_seeds = <seeds> | ||
| mint::name = <expr> // requires symbol + uri | ||
| mint::symbol = <expr> // requires name + uri | ||
| mint::uri = <expr> // requires name + symbol | ||
| mint::update_authority = <ident> // requires name, symbol, uri | ||
| mint::additional_metadata = <expr> // requires name, symbol, uri | ||
| ``` | ||
|
|
||
| ```rust | ||
| #[account(mut)] | ||
| #[light_account(init, mint, | ||
| mint::signer = mint_signer, | ||
| mint::authority = fee_payer, | ||
| mint::decimals = 9, | ||
| mint::seeds = &[MINT_SIGNER_SEED, self.authority.to_account_info().key.as_ref()], | ||
| )] | ||
| pub mint: UncheckedAccount<'info>, | ||
| ``` | ||
|
|
||
| <Accordion title="Mint with metadata"> | ||
|
|
||
| ```rust | ||
| #[account(mut)] | ||
| #[light_account(init, mint, | ||
| mint::signer = mint_signer, | ||
| mint::authority = fee_payer, | ||
| mint::decimals = 9, | ||
| mint::seeds = &[MINT_SIGNER_SEED, self.authority.to_account_info().key.as_ref()], | ||
| mint::bump = params.mint_signer_bump, | ||
| mint::name = params.name.clone(), | ||
| mint::symbol = params.symbol.clone(), | ||
| mint::uri = params.uri.clone(), | ||
| mint::update_authority = authority, | ||
| mint::additional_metadata = params.additional_metadata.clone() | ||
| )] | ||
| pub mint: UncheckedAccount<'info>, | ||
| ``` | ||
|
|
||
| </Accordion> | ||
|
|
||
| Examples: [Github](https://github.com/Lightprotocol/examples-light-token/tree/main/programs/anchor/basic-macros/create-mint) | ||
|
|
||
| --- | ||
|
|
||
| ## Required accounts | ||
|
|
||
| Add these to your `init` struct alongside the fields above. The `LightAccounts` derive macro appends additional protocol accounts to the instruction at runtime — you don't add those manually. | ||
|
|
||
| <Tabs> | ||
| <Tab title="PDA"> | ||
|
|
||
| | Account | Description | | ||
| |:-|:-| | ||
| | `compression_config` | Per-program PDA. Stores rent sponsor address and compression settings. Initialize once via `InitializeRentFreeConfig`. | | ||
| | `pda_rent_sponsor` | Per-program PDA. Receives rent-exemption lamports when accounts compress. Must be mutable. | | ||
| | `system_program` | Solana System Program. Transfers lamports for rent-exemption. | | ||
|
|
||
| </Tab> | ||
| <Tab title="Token / ATA / Mint"> | ||
|
|
||
| | Account | Description | | ||
| |:-|:-| | ||
| | `light_token_compressible_config` | Protocol PDA. Stores rent-config for Light Token accounts. | | ||
| | `light_token_rent_sponsor` | Protocol PDA. Holds the lamport pool that sponsors rent-exemption. Reclaims lamports when accounts compress. | | ||
| | `light_token_program` | Light Token program. CPI target for token, ATA, and mint creation. | | ||
| | `light_token_cpi_authority` | Signer PDA. Authorizes CPI calls from your program to the Light Token program. | | ||
| | `system_program` | Solana System Program. Transfers lamports for rent-exemption. | | ||
|
|
||
| </Tab> | ||
| </Tabs> | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Capitalize "GitHub" correctly (applies to lines 39, 73, 101, 165).
The official spelling uses a capital "H". This appears four times in the file.
📝 Committable suggestion
🧰 Tools
🪛 LanguageTool
[uncategorized] ~39-~39: The official name of this software platform is spelled with a capital “H”.
Context: ...ccount<'info, Counter>, ``` Examples: [Github](https://github.com/Lightprotocol/examp...
(GITHUB)
🤖 Prompt for AI Agents