Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
367c00f
fix(token-sdk, token-pinocchio): make authority/owner readonly in clo…
Feb 19, 2026
f82717e
fix(token-sdk): return ProgramError from get_token_account_balance
Feb 19, 2026
6187e99
fix(tests): add max_top_up field to Approve and Revoke in compressed-…
Feb 19, 2026
d49cc7d
before reverting pro
Feb 19, 2026
c57dea9
rm max top up
Feb 19, 2026
4fa68c3
rm max top up
Feb 19, 2026
5eaa46d
fix(tests): mark PDA authority writable in invoke_signed tests
Feb 19, 2026
0b2adda
fix: restore accidentally deleted anchor build artifacts
Feb 19, 2026
c89bf73
fix
Feb 19, 2026
28c394d
fix(tests): restore max_top_up exceeded tests for approve and revoke
Feb 19, 2026
5023ccf
fix(token-sdk): use short wire format to match pinocchio (no max_top_…
Feb 19, 2026
2c64355
style: fix formatting in test files
Feb 19, 2026
0762ce0
fix(token-sdk): mandatory fee_payer, authority always readonly, build…
Feb 20, 2026
1789ebe
before ci
Feb 20, 2026
2fff677
style: fix formatting in sdk test files
Feb 20, 2026
16a7f3b
fix(sdk-test): swap fee_payer and program accounts in transfer test
Feb 20, 2026
ad15531
fix(token-sdk): make owner/authority readonly in approve, revoke, clo…
ananas-block Feb 20, 2026
050cf75
test(sdk-pinocchio): add invoke_with_fee_payer handlers and tests
ananas-block Feb 20, 2026
4bb8746
fix(sdk-pinocchio-test): add fee_payer to transfer_checked tests
ananas-block Feb 20, 2026
d703b25
test(sdk-test): add invoke_with_fee_payer handlers and tests
ananas-block Feb 20, 2026
29e516d
fmt
ananas-block Feb 20, 2026
eab1941
align change
Feb 24, 2026
86e6d00
Switch TransferInterface LightToLight from Transfer to TransferChecked
Feb 24, 2026
7d29f84
add macro
Feb 24, 2026
002e9c8
fix: make PDA authority readonly, regenerate compressed-token-sdk README
Feb 25, 2026
2e10759
fix: pinocchio sdk inconsistencies
ananas-block Feb 26, 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
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ async fn test_approve_revoke_compressible() -> Result<(), RpcError> {
delegate: delegate.pubkey(),
owner: owner.pubkey(),
amount: approve_amount,
fee_payer: payer.pubkey(),
}
.instruction()
.map_err(|e| {
Expand All @@ -460,6 +461,7 @@ async fn test_approve_revoke_compressible() -> Result<(), RpcError> {
let revoke_ix = Revoke {
token_account: account_pubkey,
owner: owner.pubkey(),
fee_payer: payer.pubkey(),
}
.instruction()
.map_err(|e| RpcError::AssertRpcError(format!("Failed to create revoke instruction: {}", e)))?;
Expand Down
30 changes: 10 additions & 20 deletions program-tests/compressed-token-test/tests/light_token/burn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ async fn test_burn_success_cases() {
mint: ctx.mint_pda,
amount: burn_amount,
authority: ctx.owner_keypair.pubkey(),
max_top_up: None,
fee_payer: None,
fee_payer: ctx.payer.pubkey(),
}
.instruction()
.unwrap();
Expand Down Expand Up @@ -79,8 +78,7 @@ async fn test_burn_success_cases() {
mint: ctx.mint_pda,
amount: burn_amount,
authority: ctx.owner_keypair.pubkey(),
max_top_up: None,
fee_payer: None,
fee_payer: ctx.payer.pubkey(),
}
.instruction()
.unwrap();
Expand Down Expand Up @@ -130,8 +128,7 @@ async fn test_burn_fails() {
mint: other_mint_pda, // Wrong mint
amount: 50,
authority: ctx.owner_keypair.pubkey(),
max_top_up: None,
fee_payer: None,
fee_payer: ctx.payer.pubkey(),
}
.instruction()
.unwrap();
Expand Down Expand Up @@ -161,8 +158,7 @@ async fn test_burn_fails() {
mint: ctx.mint_pda,
amount: 50,
authority: ctx.owner_keypair.pubkey(),
max_top_up: None,
fee_payer: None,
fee_payer: ctx.payer.pubkey(),
}
.instruction()
.unwrap();
Expand Down Expand Up @@ -208,8 +204,7 @@ async fn test_burn_fails() {
mint: ctx.mint_pda,
amount: 50,
authority: ctx.owner_keypair.pubkey(),
max_top_up: None,
fee_payer: None,
fee_payer: ctx.payer.pubkey(),
}
.instruction()
.unwrap();
Expand Down Expand Up @@ -239,8 +234,7 @@ async fn test_burn_fails() {
mint: ctx.mint_pda,
amount: 200, // More than 100 balance
authority: ctx.owner_keypair.pubkey(),
max_top_up: None,
fee_payer: None,
fee_payer: ctx.payer.pubkey(),
}
.instruction()
.unwrap();
Expand Down Expand Up @@ -275,8 +269,7 @@ async fn test_burn_fails() {
mint: ctx.mint_pda,
amount: 50,
authority: wrong_authority.pubkey(),
max_top_up: None,
fee_payer: None,
fee_payer: ctx.payer.pubkey(),
}
.instruction()
.unwrap();
Expand Down Expand Up @@ -379,8 +372,7 @@ async fn setup_burn_test() -> BurnTestContext {
destination: ctoken_ata,
amount: 100,
authority: mint_authority.pubkey(),
max_top_up: None,
fee_payer: None,
fee_payer: payer.pubkey(),
}
.instruction()
.unwrap();
Expand Down Expand Up @@ -425,8 +417,7 @@ async fn test_burn_checked_success() {
amount: burn_amount,
decimals: 8, // Correct decimals
authority: ctx.owner_keypair.pubkey(),
max_top_up: None,
fee_payer: None,
fee_payer: ctx.payer.pubkey(),
}
.instruction()
.unwrap();
Expand Down Expand Up @@ -458,8 +449,7 @@ async fn test_burn_checked_wrong_decimals() {
amount: 50,
decimals: 7, // Wrong decimals
authority: ctx.owner_keypair.pubkey(),
max_top_up: None,
fee_payer: None,
fee_payer: ctx.payer.pubkey(),
}
.instruction()
.unwrap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,7 @@ async fn test_ctoken_transfer_fails_when_mint_paused() {
amount: 100_000_000,
decimals: 9,
authority: owner.pubkey(),
max_top_up: None,
fee_payer: None,
fee_payer: context.payer.pubkey(),
}
.instruction()
.unwrap();
Expand Down Expand Up @@ -243,8 +242,7 @@ async fn test_ctoken_transfer_fails_with_non_zero_transfer_fee() {
amount: 100_000_000,
decimals: 9,
authority: owner.pubkey(),
max_top_up: None,
fee_payer: None,
fee_payer: context.payer.pubkey(),
}
.instruction()
.unwrap();
Expand Down Expand Up @@ -292,8 +290,7 @@ async fn test_ctoken_transfer_fails_with_non_nil_transfer_hook() {
amount: 100_000_000,
decimals: 9,
authority: owner.pubkey(),
max_top_up: None,
fee_payer: None,
fee_payer: context.payer.pubkey(),
}
.instruction()
.unwrap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,7 @@ pub async fn approve_and_assert(
delegate,
owner: context.owner_keypair.pubkey(),
amount,
fee_payer: context.payer.pubkey(),
}
.instruction()
.unwrap();
Expand Down Expand Up @@ -947,6 +948,7 @@ pub async fn approve_and_assert_fails(
delegate,
owner: authority.pubkey(),
amount,
fee_payer: context.payer.pubkey(),
}
.instruction()
.unwrap();
Expand Down Expand Up @@ -976,6 +978,7 @@ pub async fn revoke_and_assert(context: &mut AccountTestContext, name: &str) {
let revoke_ix = Revoke {
token_account: context.token_account_keypair.pubkey(),
owner: context.owner_keypair.pubkey(),
fee_payer: context.payer.pubkey(),
}
.instruction()
.unwrap();
Expand Down Expand Up @@ -1009,6 +1012,7 @@ pub async fn revoke_and_assert_fails(
let mut instruction = Revoke {
token_account,
owner: authority.pubkey(),
fee_payer: context.payer.pubkey(),
}
.instruction()
.unwrap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -860,8 +860,7 @@ async fn transfer_checked_and_assert(
amount,
decimals,
authority: authority.pubkey(),
max_top_up: None,
fee_payer: None,
fee_payer: context.payer.pubkey(),
}
.instruction()
.unwrap();
Expand Down Expand Up @@ -902,8 +901,7 @@ async fn transfer_checked_and_assert_fails(
amount,
decimals,
authority: authority.pubkey(),
max_top_up: None,
fee_payer: None,
fee_payer: context.payer.pubkey(),
}
.instruction()
.unwrap();
Expand Down Expand Up @@ -1075,9 +1073,9 @@ async fn test_ctoken_transfer_checked_max_top_up_exceeded() {
amount: 100,
decimals: 9,
authority: owner_keypair.pubkey(),
max_top_up: Some(1),
fee_payer: None,
fee_payer: context.payer.pubkey(),
}
.with_max_top_up(1)
.instruction()
.unwrap();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,7 @@ async fn test_transfer_requires_checked_for_restricted_extensions() {
destination: account_b_pubkey,
amount: transfer_amount,
authority: owner.pubkey(),
max_top_up: Some(u16::MAX), // u16::MAX = no limit, includes system program for compressible
fee_payer: None,
fee_payer: payer.pubkey(),
}
.instruction()
.unwrap();
Expand All @@ -186,8 +185,7 @@ async fn test_transfer_requires_checked_for_restricted_extensions() {
amount: transfer_amount,
decimals: 9,
authority: owner.pubkey(),
max_top_up: Some(u16::MAX), // u16::MAX = no limit, includes system program for compressible
fee_payer: None,
fee_payer: payer.pubkey(),
}
.instruction()
.unwrap();
Expand Down
6 changes: 2 additions & 4 deletions program-tests/compressed-token-test/tests/mint/burn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ async fn test_ctoken_burn() {
mint: ctx.mint_pda,
amount: 500,
authority: ctx.owner_keypair.pubkey(),
max_top_up: None,
fee_payer: None,
fee_payer: ctx.payer.pubkey(),
}
.instruction()
.unwrap();
Expand All @@ -141,8 +140,7 @@ async fn test_ctoken_burn() {
mint: ctx.mint_pda,
amount: 500,
authority: ctx.owner_keypair.pubkey(),
max_top_up: None,
fee_payer: None,
fee_payer: ctx.payer.pubkey(),
}
.instruction()
.unwrap();
Expand Down
12 changes: 4 additions & 8 deletions program-tests/compressed-token-test/tests/mint/mint_to.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ async fn test_ctoken_mint_to() {
destination: ctx.ctoken_account,
amount: 500,
authority: ctx.mint_authority.pubkey(),
max_top_up: None,
fee_payer: None,
fee_payer: ctx.payer.pubkey(),
}
.instruction()
.unwrap();
Expand All @@ -119,8 +118,7 @@ async fn test_ctoken_mint_to() {
destination: ctx.ctoken_account,
amount: 500,
authority: ctx.mint_authority.pubkey(),
max_top_up: None,
fee_payer: None,
fee_payer: ctx.payer.pubkey(),
}
.instruction()
.unwrap();
Expand Down Expand Up @@ -171,8 +169,7 @@ async fn test_ctoken_mint_to_checked_success() {
amount: 500,
decimals: 8, // Correct decimals
authority: ctx.mint_authority.pubkey(),
max_top_up: None,
fee_payer: None,
fee_payer: ctx.payer.pubkey(),
}
.instruction()
.unwrap();
Expand Down Expand Up @@ -214,8 +211,7 @@ async fn test_ctoken_mint_to_checked_wrong_decimals() {
amount: 500,
decimals: 7, // Wrong decimals
authority: ctx.mint_authority.pubkey(),
max_top_up: None,
fee_payer: None,
fee_payer: ctx.payer.pubkey(),
}
.instruction()
.unwrap();
Expand Down
3 changes: 1 addition & 2 deletions program-tests/registry-test/tests/compressible.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1253,8 +1253,7 @@ async fn mint_to_token<R: Rpc>(
destination,
amount,
authority: mint_authority.pubkey(),
max_top_up: None,
fee_payer: None,
fee_payer: payer.pubkey(),
}
.instruction()
.map_err(|e| RpcError::CustomError(format!("Failed to create MintTo instruction: {:?}", e)))?;
Expand Down
20 changes: 10 additions & 10 deletions sdk-libs/compressed-token-sdk/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<!-- cargo-rdme start -->

# Light Compressed Token SDK
# Light Token SDK

Low-level SDK for compressed token operations on Light Protocol.
Low-level SDK for light token operations on Light Protocol.

This crate provides the core building blocks for working with compressed token accounts,
This crate provides the core building blocks for working with light token accounts,
including instruction builders for transfers, mints, and compress/decompress operations.

## Compressed Token Accounts
## Light Token Accounts
- are on Solana mainnet.
- are compressed accounts.
- can hold Light Mint and SPL Mint tokens.
Expand All @@ -16,14 +16,14 @@ including instruction builders for transfers, mints, and compress/decompress ope

## Difference to Light-Token:
light-token: Solana account that holds token balances of light-mints, SPL or Token 22 mints.
Compressed token: Compressed account storing token data. Rent-free, for storage and distribution.
Compressed light token: Compressed account storing token data. Rent-free, for storage and distribution.

## Features

- `v1` - Enable v1 compressed token support
- `v1` - Enable v1 light token support
- `anchor` - Enable Anchor framework integration

For full examples, see the [Compressed Token Examples](https://github.com/Lightprotocol/examples-zk-compression).
For full examples, see the [Light Token Examples](https://github.com/Lightprotocol/examples-zk-compression).

## Operations reference

Expand All @@ -38,7 +38,7 @@ For full examples, see the [Compressed Token Examples](https://github.com/Lightp
| Compress SPL account | [create-compressed-token-accounts](https://www.zkcompression.com/compressed-tokens/guides/create-compressed-token-accounts) | [example](https://github.com/Lightprotocol/examples-zk-compression/blob/main/compressed-token-cookbook/actions/compress-spl-account.ts) |
| Decompress | [create-compressed-token-accounts](https://www.zkcompression.com/compressed-tokens/guides/create-compressed-token-accounts) | [example](https://github.com/Lightprotocol/examples-zk-compression/blob/main/compressed-token-cookbook/actions/decompress.ts) |
| Merge token accounts | [create-compressed-token-accounts](https://www.zkcompression.com/compressed-tokens/guides/create-compressed-token-accounts) | [example](https://github.com/Lightprotocol/examples-zk-compression/blob/main/compressed-token-cookbook/actions/merge-token-accounts.ts) |
| Create token pool | [create-compressed-token-accounts](https://www.zkcompression.com/compressed-tokens/guides/create-compressed-token-accounts) | [example](https://github.com/Lightprotocol/examples-zk-compression/blob/main/compressed-token-cookbook/actions/create-token-pool.ts) |
| Create SPL interface PDA | [create-compressed-token-accounts](https://www.zkcompression.com/compressed-tokens/guides/create-compressed-token-accounts) | [example](https://github.com/Lightprotocol/examples-zk-compression/blob/main/compressed-token-cookbook/actions/create-token-pool.ts) |

### Toolkit guides

Expand All @@ -49,8 +49,8 @@ For full examples, see the [Compressed Token Examples](https://github.com/Lightp

## Modules

- [`compressed_token`] - Core compressed token types and instruction builders
- [`error`] - Error types for compressed token operations
- [`compressed_token`] - Core light token types and instruction builders
- [`error`] - Error types for light token operations
- [`utils`] - Utility functions and default account configurations
- [`constants`] - Program IDs and other constants
- [`spl_interface`] - SPL interface PDA derivation utilities
Expand Down
Loading
Loading