Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
6a7061c
Add example programs: escrow, fundraiser, token-swap, light-token-minter
Feb 18, 2026
5a86225
Update programs/anchor/escrow/src/instructions/make_offer.rs
tilo-14 Feb 18, 2026
d62f06d
Update programs/anchor/escrow/src/instructions/take_offer.rs
tilo-14 Feb 18, 2026
96df9be
Update programs/anchor/fundraiser/src/instructions/refund.rs
tilo-14 Feb 18, 2026
cd05444
Update programs/anchor/token-swap/src/instructions/swap_exact_tokens_…
tilo-14 Feb 18, 2026
98a516d
Update programs/anchor/fundraiser/src/instructions/refund.rs
tilo-14 Feb 18, 2026
8063d9a
fixes. but still buggy
Feb 18, 2026
6b0c491
fix(examples): remove redundant .map_err() on get_token_account_balance
Feb 19, 2026
f0eb32d
fix(deps): unify Light crates to path deps to resolve duplicate light…
Feb 19, 2026
46e90a8
fix: use Option<AccountInfo> for optional spl_interface_pda accounts
Feb 19, 2026
b977a54
fix(examples): add max_top_up field to ApproveCpi and RevokeCpi
Feb 19, 2026
2dac8fa
refactor(examples): use TransferInterface and unified transfer routing
Feb 19, 2026
944aea8
align examples with authority-owner-mutability SDK changes
Feb 25, 2026
0d7d365
fix(deps): switch light-* crates from git branch to crates.io 0.23.0
Feb 27, 2026
e6957df
ci: add pinocchio-swap to rust test workflow
Feb 27, 2026
ba28a7c
ci: align TypeScript workflow with shared setup action
Feb 27, 2026
40615a8
docs: fix stale references after crates.io migration
Feb 27, 2026
3a94b55
fix(tests): update pinocchio-swap tests for light-client 0.23.0 API
Feb 27, 2026
d71e26f
fix tranfsr ci
Feb 27, 2026
540e74e
docs: fix ATA and T22 abbreviations in swap comments
Feb 27, 2026
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
3 changes: 1 addition & 2 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ inputs:
light-cli-version:
description: "Light CLI version"
required: false
default: "alpha"
default: "beta"
photon-indexer:
description: "Install Photon indexer (required for TypeScript tests)"
required: false
Expand All @@ -29,7 +29,6 @@ runs:
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ inputs.rust-toolchain }}
rustflags: ""
cache-workspaces: ${{ inputs.example || '.' }}

- name: Setup Node.js
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/rust-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ jobs:
- light-token-macro-create-mint
- light-token-macro-create-token-account
- create-and-transfer
# example programs
- escrow
- fundraiser
- light-token-minter
- swap_example
steps:
- uses: actions/checkout@v4

Expand All @@ -54,6 +59,28 @@ jobs:
solana-cli-version: ${{ env.SOLANA_CLI_VERSION }}
rust-toolchain: ${{ env.RUST_TOOLCHAIN }}

- name: Build light-token-minter
if: contains(fromJson('["escrow", "fundraiser", "swap_example"]'), matrix.package)
working-directory: programs/anchor
run: cargo build-sbf --manifest-path light-token-minter/Cargo.toml

- name: Test
working-directory: programs/anchor
run: cargo test-sbf -p ${{ matrix.package }} -- --test-threads=1

test-pinocchio:
name: pinocchio-swap
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup environment
uses: ./.github/actions/setup
with:
example: pinocchio/swap
solana-cli-version: ${{ env.SOLANA_CLI_VERSION }}
rust-toolchain: ${{ env.RUST_TOOLCHAIN }}

- name: Test
working-directory: pinocchio/swap
run: cargo test-sbf -p pinocchio-swap -- --test-threads=1
122 changes: 43 additions & 79 deletions .github/workflows/typescript-tests.yml
Original file line number Diff line number Diff line change
@@ -1,88 +1,52 @@
name: TypeScript

on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
branches:
- main
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
SOLANA_CLI_VERSION: "2.1.21"
NODE_VERSION: "22"
SOLANA_CLI_VERSION: "2.3.11"
NODE_VERSION: "22"

jobs:
typescript-tests:
name: TypeScript Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: Cache Solana CLI tools
uses: actions/cache@v4
with:
path: |
~/.cache/solana/
~/.local/share/solana/
key: solana-cli-${{ runner.os }}-${{ env.SOLANA_CLI_VERSION }}

- name: Install Solana CLI tools
run: |
sh -c "$(curl -sSfL https://release.anza.xyz/v${{ env.SOLANA_CLI_VERSION }}/install)"
echo "/home/runner/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH

- name: Install Light CLI
run: npm install -g @lightprotocol/zk-compression-cli@beta

- name: Install Rust (for Photon)
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
cache: false

- name: Cache Photon indexer
id: cache-photon
uses: actions/cache@v4
with:
path: ~/.cargo/bin/photon
key: photon-${{ runner.os }}-ac7df6c388db847b7693a7a1cb766a7c9d7809b5

- name: Install Photon indexer
if: steps.cache-photon.outputs.cache-hit != 'true'
run: cargo install --git https://github.com/lightprotocol/photon.git --rev ac7df6c388db847b7693a7a1cb766a7c9d7809b5 --locked
env:
RUSTFLAGS: "-A dead-code"

- name: Generate keypair
run: solana-keygen new --no-bip39-passphrase

- name: Install dependencies
working-directory: typescript-client
run: npm install

- name: Start test validator
run: |
light test-validator &
for i in $(seq 1 60); do
curl -s http://127.0.0.1:8784/health && break
sleep 2
done

- name: Run actions
working-directory: typescript-client
run: npm run test:actions

- name: Run instructions
working-directory: typescript-client
run: npm run test:instructions
typescript-tests:
name: TypeScript Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup environment
uses: ./.github/actions/setup
with:
example: typescript-client
solana-cli-version: ${{ env.SOLANA_CLI_VERSION }}
photon-indexer: "true"

- name: Install dependencies
working-directory: typescript-client
run: npm install

- name: Start test validator
run: |
light test-validator &
for i in $(seq 1 60); do
curl -s http://127.0.0.1:8784/health && break
sleep 2
done

- name: Run actions
working-directory: typescript-client
run: npm run test:actions

- name: Run instructions
working-directory: typescript-client
run: npm run test:instructions
7 changes: 5 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ cd programs/anchor && cargo test-sbf -p swap_example
# Run a single test by name
cd programs/anchor && cargo test-sbf -p escrow -- test_escrow_spl

# Pinocchio swap example
cd pinocchio/swap && cargo test-sbf -p pinocchio-swap

# TypeScript client examples
cd typescript-client && npm install && npm run create-mint:action
```
Expand Down Expand Up @@ -64,9 +67,9 @@ Tests follow: `create_test_rpc()` → `setup_*_test(config)` → `create_token_a

Light accounts auto-compress after rent expires. Escrow tests exercise the full cycle: create → `warp_to_compress` (calls `rpc.warp_epoch_forward(30)`) → `load_light_accounts` → transact. Fundraiser skips this because `Fundraiser` state lacks `LightAccount` derive.

### Local path dependencies
### Dependencies

`light-client` and `light-program-test` use local path deps pointing to `~/Workspace/light-protocol/`. The workspace `Cargo.toml` also patches all `light-*` crates to local paths to avoid version conflicts.
All `light-*` crates are sourced from crates.io (currently 0.23.0).

## Key SDK patterns

Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ Light token is a high-performance token standard that reduces the cost of mint a
| mint-to | [Action](rust-client/actions/mint_to.rs) | [Instruction](rust-client/instructions/mint_to.rs) | Mint tokens to a light-account |
| mint-to-checked | | [Instruction](rust-client/instructions/mint_to_checked.rs) | Mint tokens with decimal validation |
| transfer-interface | [Action](rust-client/actions/transfer_interface.rs) | [Instruction](rust-client/instructions/transfer_interface.rs) | Transfer between light-token, T22, and SPL accounts |
| transfer-checked | [Action](rust-client/actions/transfer_checked.rs) | [Instruction](rust-client/instructions/transfer_checked.rs) | Transfer with decimal validation |
| spl-to-light-transfer | | [Instruction](rust-client/instructions/spl_to_light_transfer.rs) | Transfer from SPL to Light via TransferInterface |
| wrap | [Action](rust-client/actions/wrap.rs) | | Wrap SPL/T22 to light-token |
| unwrap | [Action](rust-client/actions/unwrap.rs) | | Unwrap light-token to SPL/T22 |
Expand Down
Loading