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
4 changes: 2 additions & 2 deletions .github/workflows/typescript-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ jobs:
uses: actions/cache@v4
with:
path: ~/.cargo/bin/photon
key: photon-${{ runner.os }}-1a785036de52896b68d06413e3b0231122d6aa4a
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 1a785036de52896b68d06413e3b0231122d6aa4a --locked
run: cargo install --git https://github.com/lightprotocol/photon.git --rev ac7df6c388db847b7693a7a1cb766a7c9d7809b5 --locked
env:
RUSTFLAGS: "-A dead-code"

Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@
**/*.json.bak
**/test-ledger
**/target
cli/accounts/
cli/accounts
README.html
README_files/
104 changes: 79 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,84 @@ Light token is a high-performance token standard that reduces the cost of mint a
* Light-token accounts can hold balances from any light, SPL, or Token-2022 mint.
* Light-mint accounts represent a unique mint and optionally can store token-metadata. Functionally equivalent to SPL mints.

### Toolkits

- **[Payments and Wallets](toolkits/payments-and-wallets/)** - All you need for wallet integrations and payment flows. Minimal API differences to SPL.
- **[Streaming Tokens](toolkits/streaming-tokens/)** - Stream mint events using Laserstream

### TypeScript Client

TypeScript examples for light-token-sdk.

- **create-mint** - Create a light-token mint
- [Action](typescript-client/actions/create-mint.ts) | [Instruction](typescript-client/instructions/create-mint.ts)
- **create-ata** - Create an associated light-token account
- [Action](typescript-client/actions/create-ata.ts) | [Instruction](typescript-client/instructions/create-ata.ts)
- **load-ata** - Load token accounts from light-token, compressed tokens, SPL/T22 to one unified balance.
- [Action](typescript-client/actions/load-ata.ts) | [Instruction](typescript-client/instructions/load-ata.ts)
- **mint-to** - Mint tokens to a light-account
- [Action](typescript-client/actions/mint-to.ts) | [Instruction](typescript-client/instructions/mint-to.ts)
- **transfer-interface** - Transfer between light-token, T22, and SPL accounts
- [Action](typescript-client/actions/transfer-interface.ts) | [Instruction](typescript-client/instructions/transfer-interface.ts)
- **wrap** - Wrap SPL/T22 to light-token
- [Action](typescript-client/actions/wrap.ts)
- **unwrap** - Unwrap light-token to SPL/T22
- [Action](typescript-client/actions/unwrap.ts)

## Toolkits

* **[Payments and Wallets](toolkits/payments-and-wallets/)** - All you need for wallet integrations and payment flows. Minimal API differences to SPL.
* **[Streaming Tokens](toolkits/streaming-tokens/)** - Stream mint events using Laserstream

## TypeScript Client

* **create-mint** - Create a light-token mint with metadata
* [Action](typescript-client/actions/create-mint.ts) | [Instruction](typescript-client/instructions/create-mint.ts)
* **create-ata** - Create an associated light-token account
* [Action](typescript-client/actions/create-ata.ts) | [Instruction](typescript-client/instructions/create-ata.ts)
* **load-ata** - Load token accounts from light-token, compressed tokens, SPL/T22 to one unified balance
* [Action](typescript-client/actions/load-ata.ts) | [Instruction](typescript-client/instructions/load-ata.ts)
* **mint-to** - Mint tokens to a light-account
* [Action](typescript-client/actions/mint-to.ts) | [Instruction](typescript-client/instructions/mint-to.ts)
* **transfer-interface** - Transfer between light-token, T22, and SPL accounts
* [Action](typescript-client/actions/transfer-interface.ts) | [Instruction](typescript-client/instructions/transfer-interface.ts)
* **wrap** - Wrap SPL/T22 to light-token
* [Action](typescript-client/actions/wrap.ts) | [Instruction](typescript-client/instructions/wrap.ts)
* **unwrap** - Unwrap light-token to SPL/T22
* [Action](typescript-client/actions/unwrap.ts) | [Instruction](typescript-client/instructions/unwrap.ts)
* **delegate-approve** - Approve delegate
* [Action](typescript-client/actions/delegate-approve.ts)
* **delegate-revoke** - Revoke delegate
* [Action](typescript-client/actions/delegate-revoke.ts)

## Rust Client

* **create-mint** - Create a light-token mint with metadata
* [Action](rust-client/actions/create_mint.rs) | [Instruction](rust-client/instructions/create_mint.rs)
* **create-ata** - Create an associated light-token account
* [Action](rust-client/actions/create_ata.rs) | [Instruction](rust-client/instructions/create_ata.rs)
* **create-token-account** - Create a light-token account with custom owner
* [Instruction](rust-client/instructions/create_token_account.rs)
* **mint-to** - Mint tokens to a light-account
* [Action](rust-client/actions/mint_to.rs) | [Instruction](rust-client/instructions/mint_to.rs)
* **mint-to-checked** - Mint tokens with decimal validation
* [Instruction](rust-client/instructions/mint_to_checked.rs)
* **transfer-interface** - Transfer between light-token, T22, and SPL accounts
* [Action](rust-client/actions/transfer_interface.rs) | [Instruction](rust-client/instructions/transfer_interface.rs)
* **transfer-checked** - Transfer with decimal validation
* [Action](rust-client/actions/transfer_checked.rs) | [Instruction](rust-client/instructions/transfer_checked.rs)
* **spl-to-light-transfer** - Transfer from SPL to Light via TransferInterface
* [Instruction](rust-client/instructions/spl_to_light_transfer.rs)
* **wrap** - Wrap SPL/T22 to light-token
* [Action](rust-client/actions/wrap.rs)
* **unwrap** - Unwrap light-token to SPL/T22
* [Action](rust-client/actions/unwrap.rs)
* **burn** - Burn tokens
* [Instruction](rust-client/instructions/burn.rs)
* **burn-checked** - Burn tokens with decimal validation
* [Instruction](rust-client/instructions/burn_checked.rs)
* **approve** - Approve delegate
* [Action](rust-client/actions/approve.rs) | [Instruction](rust-client/instructions/approve.rs)
* **revoke** - Revoke delegate
* [Action](rust-client/actions/revoke.rs) | [Instruction](rust-client/instructions/revoke.rs)
* **freeze** - Freeze a token account
* [Instruction](rust-client/instructions/freeze.rs)
* **thaw** - Thaw a frozen token account
* [Instruction](rust-client/instructions/thaw.rs)
* **close** - Close a token account
* [Instruction](rust-client/instructions/close.rs)

## Run

```bash
# TypeScript
cd typescript-client
npm run create-mint:action
npm run mint-to:action
# See package.json for all scripts

# Rust
cd rust-client
cargo run --example action_create_mint
cargo run --example instruction_mint_to_checked
```

## Documentation

Learn more [about to Light-Token here](https://www.zkcompression.com/light-token/welcome).
Learn more [about Light-Token here](https://www.zkcompression.com/light-token/welcome).
Loading