Skip to content

Commit 6ebf66d

Browse files
author
tilo-14
committed
feat: add program examples for light-token SDK (native + anchor)
1 parent fa941d2 commit 6ebf66d

35 files changed

Lines changed: 23051 additions & 0 deletions

program-examples/README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Light Token Program Examples
2+
3+
Program examples for compressed tokens (cToken) using Light Protocol.
4+
5+
## Structure
6+
7+
```
8+
program-examples/
9+
├── native/ # Native Rust programs with CPI examples
10+
├── anchor/ # Anchor programs (coming soon)
11+
└── CLAUDE.md # Detailed documentation
12+
```
13+
14+
## Operations
15+
16+
| Operation | Description |
17+
|-----------|-------------|
18+
| **create-mint** | Create a compressed mint (cMint) with optional metadata |
19+
| **create-ata** | Create an associated cToken account |
20+
| **create-token-account** | Create a cToken account with custom owner |
21+
| **mint-to** | Mint tokens from cMint to cToken account |
22+
| **transfer-interface** | Unified transfer (cToken↔cToken, SPL↔cToken) |
23+
| **close** | Close a cToken account and reclaim rent |
24+
25+
## Build
26+
27+
### Native
28+
29+
```bash
30+
cd native/
31+
cargo build-sbf
32+
```
33+
34+
### Anchor
35+
36+
```bash
37+
cd anchor/<operation>/
38+
anchor build
39+
```
40+
41+
## Test
42+
43+
See individual READMEs in `native/` and `anchor/` directories.
44+
45+
## Resources
46+
47+
- [Light Protocol Documentation](https://www.zkcompression.com/)
48+
- [Light Protocol GitHub](https://github.com/Lightprotocol/light-protocol)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[features]
2+
seeds = false
3+
skip-lint = false
4+
5+
[programs.localnet]
6+
light_token_anchor_examples = "LtAnchorExmp1eProgram111111111111111111111111"
7+
8+
[programs.devnet]
9+
light_token_anchor_examples = "LtAnchorExmp1eProgram111111111111111111111111"
10+
11+
[registry]
12+
url = "https://api.apr.dev"
13+
14+
[provider]
15+
cluster = "Localnet"
16+
wallet = "~/.config/solana/id.json"
17+
18+
[scripts]
19+
test = "ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
20+

0 commit comments

Comments
 (0)