-
Notifications
You must be signed in to change notification settings - Fork 87
feat: ts interface #2071
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
feat: ts interface #2071
Conversation
WalkthroughA new documentation file Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Notes:
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro ⛔ Files ignored due to path filters (119)
📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (1)**/*.md📄 CodeRabbit inference engine (DOCS.md)
Files:
🧠 Learnings (31)📓 Common learnings📚 Learning: 2025-11-24T18:01:54.689ZApplied to files:
📚 Learning: 2025-11-24T18:01:47.207ZApplied to files:
📚 Learning: 2025-12-07T18:10:14.595ZApplied to files:
📚 Learning: 2025-12-07T03:17:28.794ZApplied to files:
📚 Learning: 2025-11-24T18:01:54.689ZApplied to files:
📚 Learning: 2025-11-24T18:01:54.689ZApplied to files:
📚 Learning: 2025-11-24T18:01:54.689ZApplied to files:
📚 Learning: 2025-12-06T00:50:17.433ZApplied to files:
📚 Learning: 2025-11-24T18:01:54.689ZApplied to files:
📚 Learning: 2025-11-24T17:59:13.714ZApplied to files:
📚 Learning: 2025-12-07T18:10:14.595ZApplied to files:
📚 Learning: 2025-12-07T18:10:14.595ZApplied to files:
📚 Learning: 2025-12-06T00:50:17.433ZApplied to files:
📚 Learning: 2025-11-24T18:01:54.689ZApplied to files:
📚 Learning: 2025-11-24T18:01:54.689ZApplied to files:
📚 Learning: 2025-12-07T18:10:14.595ZApplied to files:
📚 Learning: 2025-11-24T17:55:17.323ZApplied to files:
📚 Learning: 2025-11-24T17:59:54.233ZApplied to files:
📚 Learning: 2025-11-24T17:54:38.537ZApplied to files:
📚 Learning: 2025-12-07T18:10:14.595ZApplied to files:
📚 Learning: 2025-12-06T00:50:17.433ZApplied to files:
📚 Learning: 2025-12-06T00:50:17.433ZApplied to files:
📚 Learning: 2025-11-24T17:56:00.229ZApplied to files:
📚 Learning: 2025-12-06T00:50:17.433ZApplied to files:
📚 Learning: 2025-11-24T17:54:38.537ZApplied to files:
📚 Learning: 2025-11-24T17:54:33.614ZApplied to files:
📚 Learning: 2025-12-07T18:10:14.595ZApplied to files:
📚 Learning: 2025-11-24T17:53:57.540ZApplied to files:
📚 Learning: 2025-12-06T00:49:57.458ZApplied to files:
📚 Learning: 2025-12-07T03:17:28.794ZApplied to files:
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
js/compressed-token/tests/e2e/compress-spl-token-account.test.ts
Outdated
Show resolved
Hide resolved
| ]); | ||
| } | ||
|
|
||
| export function createMintInstruction( |
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.
can we also make the input type an object?
( in encodeCreateMintInstructionData thats already the case.)
| }; | ||
| } | ||
|
|
||
| export function parseCTokenOnchain( |
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.
parseCTokenOnchain means parse ctoken solana account?
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.
renamed onchain/compressed in here to hot/cold for better association
87cd0b3 to
e30548d
Compare
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.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (83)
.github/workflows/js-v2.ymlis excluded by none and included by nonecli/src/commands/create-mint/index.tsis excluded by none and included by nonecli/src/utils/constants.tsis excluded by none and included by nonecli/src/utils/processPhotonIndexer.tsis excluded by none and included by nonecli/test/helpers/helpers.tsis excluded by none and included by nonejs/compressed-token/package.jsonis excluded by none and included by nonejs/compressed-token/src/actions/create-mint.tsis excluded by none and included by nonejs/compressed-token/src/compressible/derivation.tsis excluded by none and included by nonejs/compressed-token/src/compressible/helpers.tsis excluded by none and included by nonejs/compressed-token/src/compressible/index.tsis excluded by none and included by nonejs/compressed-token/src/compressible/serde.tsis excluded by none and included by nonejs/compressed-token/src/constants.tsis excluded by none and included by nonejs/compressed-token/src/index.tsis excluded by none and included by nonejs/compressed-token/src/layout-transfer2.tsis excluded by none and included by nonejs/compressed-token/src/mint/actions/create-associated-ctoken.tsis excluded by none and included by nonejs/compressed-token/src/mint/actions/create-ata-interface.tsis excluded by none and included by nonejs/compressed-token/src/mint/actions/create-mint-interface.tsis excluded by none and included by nonejs/compressed-token/src/mint/actions/get-or-create-ata-interface.tsis excluded by none and included by nonejs/compressed-token/src/mint/actions/index.tsis excluded by none and included by nonejs/compressed-token/src/mint/actions/load-ata-interface.tsis excluded by none and included by nonejs/compressed-token/src/mint/actions/mint-to-compressed.tsis excluded by none and included by nonejs/compressed-token/src/mint/actions/mint-to-interface.tsis excluded by none and included by nonejs/compressed-token/src/mint/actions/mint-to.tsis excluded by none and included by nonejs/compressed-token/src/mint/actions/update-metadata.tsis excluded by none and included by nonejs/compressed-token/src/mint/actions/update-mint.tsis excluded by none and included by nonejs/compressed-token/src/mint/actions/wrap.tsis excluded by none and included by nonejs/compressed-token/src/mint/get-account-interface.tsis excluded by none and included by nonejs/compressed-token/src/mint/helpers.tsis excluded by none and included by nonejs/compressed-token/src/mint/index.tsis excluded by none and included by nonejs/compressed-token/src/mint/instructions/create-associated-ctoken.tsis excluded by none and included by nonejs/compressed-token/src/mint/instructions/create-mint.tsis excluded by none and included by nonejs/compressed-token/src/mint/instructions/index.tsis excluded by none and included by nonejs/compressed-token/src/mint/instructions/mint-action-layout.tsis excluded by none and included by nonejs/compressed-token/src/mint/instructions/mint-to-compressed.tsis excluded by none and included by nonejs/compressed-token/src/mint/instructions/mint-to-interface.tsis excluded by none and included by nonejs/compressed-token/src/mint/instructions/mint-to.tsis excluded by none and included by nonejs/compressed-token/src/mint/instructions/update-metadata.tsis excluded by none and included by nonejs/compressed-token/src/mint/instructions/update-mint.tsis excluded by none and included by nonejs/compressed-token/src/mint/instructions/wrap.tsis excluded by none and included by nonejs/compressed-token/src/mint/serde.tsis excluded by none and included by nonejs/compressed-token/src/mint/upload.tsis excluded by none and included by nonejs/compressed-token/src/program.tsis excluded by none and included by nonejs/compressed-token/src/utils/ata-utils.tsis excluded by none and included by nonejs/compressed-token/src/utils/index.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/compress-spl-token-account.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/compress.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/create-associated-ctoken.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/create-compressed-mint.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/create-mint.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/create-token-pool.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/decompress-delegated.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/decompress.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/delegate.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/layout.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/load-ata-interface.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/merge-token-accounts.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/mint-to-compressed.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/mint-to-ctoken.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/mint-to-interface.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/mint-to.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/mint-workflow.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/multi-pool.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/rpc-multi-trees.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/rpc-token-interop.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/transfer-delegated.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/transfer.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/update-metadata.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/update-mint.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/wrap.test.tsis excluded by none and included by nonejs/compressed-token/tests/unit/serde.test.tsis excluded by none and included by nonejs/compressed-token/tests/unit/upload.test.tsis excluded by none and included by nonejs/stateless.js/package.jsonis excluded by none and included by nonejs/stateless.js/src/actions/create-account.tsis excluded by none and included by nonejs/stateless.js/src/constants.tsis excluded by none and included by nonejs/stateless.js/src/rpc-interface.tsis excluded by none and included by nonejs/stateless.js/src/rpc.tsis excluded by none and included by nonejs/stateless.js/src/test-helpers/test-rpc/get-compressed-token-accounts.tsis excluded by none and included by nonejs/stateless.js/src/test-helpers/test-rpc/test-rpc.tsis excluded by none and included by nonejs/stateless.js/src/utils/index.tsis excluded by none and included by nonejs/stateless.js/src/utils/pack-decompress.tsis excluded by none and included by nonepnpm-lock.yamlis excluded by!**/pnpm-lock.yamland included by nonescripts/devenv/install-photon.shis excluded by none and included by nonescripts/devenv/versions.shis excluded by none and included by none
📒 Files selected for processing (1)
forester/tests/e2e_test.rs(3 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
forester/**/*e2e*.rs
📄 CodeRabbit inference engine (forester/README.md)
forester/**/*e2e*.rs: Test environment variables should useTEST_MODEto specify 'local' or 'devnet' mode (default: devnet)
Test feature flagsTEST_V1_STATE,TEST_V2_STATE,TEST_V1_ADDRESS, andTEST_V2_ADDRESSshould default totrueand control which test scenarios run
Devnet mode tests requirePHOTON_RPC_URL,PHOTON_WSS_RPC_URL,PHOTON_INDEXER_URL,PHOTON_PROVER_URL, andPHOTON_API_KEYenvironment variables
Local validator mode tests should automatically spawn a local validator, start a local prover service, and use predefined local URLs (localhost:8899 for RPC, localhost:8784 for indexer)
Tests should automatically skip minting tokens, executing transactions, and root verification for disabled test types
Files:
forester/tests/e2e_test.rs
🧠 Learnings (34)
📓 Common learnings
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/INSERT_ADDRESS_QUEUE.md:0-0
Timestamp: 2025-11-24T17:57:02.558Z
Learning: Applies to program-libs/batched-merkle-tree/docs/src/merkle_tree.rs : In `insert_into_current_queue_batch` helper, handle batch state transitions: if state is `Fill`, proceed; if state is `Inserted`, verify bloom filter is zeroed, clear hash chain stores, transition to `Fill`, and reset batch metadata; if state is `Full`, return `BatchedMerkleTreeError::BatchNotReady` (error code 14301).
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/CLAUDE.md:0-0
Timestamp: 2025-11-24T17:56:00.229Z
Learning: Applies to program-libs/batched-merkle-tree/docs/**/*.rs : Use BatchedMerkleTreeAccount for state trees with integrated input queue (for nullifiers) and separate BatchedQueueAccount for output operations
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/INITIALIZE_STATE_TREE.md:0-0
Timestamp: 2025-11-24T17:56:50.011Z
Learning: Applies to program-libs/batched-merkle-tree/docs/src/initialize_state_tree.rs : Initialize integrated input queue with 2 bloom filter stores (one per batch, size = bloom_filter_capacity / 8 bytes each) and 2 hash chain stores (one per batch, capacity = input_queue_batch_size / input_queue_zkp_batch_size each)
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/UPDATE_FROM_OUTPUT_QUEUE.md:0-0
Timestamp: 2025-11-24T17:58:35.079Z
Learning: Applies to program-libs/batched-merkle-tree/docs/src/merkle_tree.rs : Zero out input queue bloom filter when all conditions are met: (1) current batch is ≥50% full (`num_inserted_elements >= batch_size / 2`), (2) current batch NOT in `Inserted` state, (3) previous batch in `Inserted` state, (4) previous batch bloom filter not already zeroed, (5) at least one tree update since batch completion (`batch.sequence_number != current_tree.sequence_number`)
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/UPDATE_FROM_OUTPUT_QUEUE.md:0-0
Timestamp: 2025-11-24T17:58:35.079Z
Learning: Applies to program-libs/batched-merkle-tree/docs/src/queue.rs : In `src/queue.rs`, define BatchedQueueAccount layout and implement `mark_as_inserted_in_merkle_tree` method to increment `num_inserted_zkp_batches` and transition batch state to `Inserted` when all ZKP batches are complete
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/UPDATE_FROM_INPUT_QUEUE.md:0-0
Timestamp: 2025-11-24T17:58:10.392Z
Learning: Applies to program-libs/batched-merkle-tree/docs/src/merkle_tree.rs : In src/merkle_tree.rs, implement BatchedMerkleTreeAccount::update_tree_from_input_queue method for batch nullify operations on StateV2 trees. The method must verify ZKP proving correctness of: old_root + queue nullifiers → new_root, update tree root, increment tree sequence_number, increment tree nullifier_next_index by zkp_batch_size, mark ZKP batch as inserted, transition batch state to Inserted when all ZKP batches complete, and zero out bloom filter when current batch is 50% inserted.
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/INSERT_OUTPUT_QUEUE.md:0-0
Timestamp: 2025-11-24T17:57:24.369Z
Learning: Applies to program-libs/batched-merkle-tree/docs/src/queue.rs : When a batch is in `Inserted` state, clear the value vec and hash chain stores, advance batch state to `Fill`, and reset batch metadata before allowing new insertions
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/CLAUDE.md:0-0
Timestamp: 2025-11-24T17:56:00.229Z
Learning: Applies to program-libs/batched-merkle-tree/docs/**/merkle_tree.rs : Tree updates from input queue must use update_tree_from_input_queue function for state trees and update_tree_from_address_queue for address trees with ZKP verification
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/INSERT_OUTPUT_QUEUE.md:0-0
Timestamp: 2025-11-24T17:57:24.369Z
Learning: Applies to program-libs/batched-merkle-tree/docs/src/queue.rs : Transition batch state from `Fill` to `Full` and increment currently_processing_batch_index when num_inserted_elements reaches batch_size in the output queue
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/QUEUE_ACCOUNT.md:0-0
Timestamp: 2025-11-24T17:57:39.230Z
Learning: Applies to program-libs/batched-merkle-tree/docs/src/queue.rs : Check `tree_capacity` (2^height) against new insertions to prevent overflow in `BatchedQueueAccount`
📚 Learning: 2025-11-24T17:57:02.558Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/INSERT_ADDRESS_QUEUE.md:0-0
Timestamp: 2025-11-24T17:57:02.558Z
Learning: Applies to program-libs/batched-merkle-tree/docs/src/merkle_tree.rs : In `insert_into_current_queue_batch` helper, handle batch state transitions: if state is `Fill`, proceed; if state is `Inserted`, verify bloom filter is zeroed, clear hash chain stores, transition to `Fill`, and reset batch metadata; if state is `Full`, return `BatchedMerkleTreeError::BatchNotReady` (error code 14301).
Applied to files:
forester/tests/e2e_test.rs
📚 Learning: 2025-11-24T17:56:00.229Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/CLAUDE.md:0-0
Timestamp: 2025-11-24T17:56:00.229Z
Learning: Applies to program-libs/batched-merkle-tree/docs/**/*.rs : Use BatchedMerkleTreeAccount for state trees with integrated input queue (for nullifiers) and separate BatchedQueueAccount for output operations
Applied to files:
forester/tests/e2e_test.rs
📚 Learning: 2025-11-24T17:58:35.079Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/UPDATE_FROM_OUTPUT_QUEUE.md:0-0
Timestamp: 2025-11-24T17:58:35.079Z
Learning: Applies to program-libs/batched-merkle-tree/docs/src/queue.rs : In `src/queue.rs`, define BatchedQueueAccount layout and implement `mark_as_inserted_in_merkle_tree` method to increment `num_inserted_zkp_batches` and transition batch state to `Inserted` when all ZKP batches are complete
Applied to files:
forester/tests/e2e_test.rs
📚 Learning: 2025-11-24T17:58:10.392Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/UPDATE_FROM_INPUT_QUEUE.md:0-0
Timestamp: 2025-11-24T17:58:10.392Z
Learning: Applies to program-libs/batched-merkle-tree/docs/src/merkle_tree.rs : In src/merkle_tree.rs, implement BatchedMerkleTreeAccount::update_tree_from_address_queue method for batch address append operations on AddressV2 trees. The method must verify ZKP proving correctness of: old_root + queue addresses → new_root using indexed Merkle tree insertion, update tree root, increment tree sequence_number, increment tree next_index by zkp_batch_size, mark ZKP batch as inserted, transition batch state to Inserted when all ZKP batches complete, and zero out bloom filter when current batch is 50% inserted.
Applied to files:
forester/tests/e2e_test.rs
📚 Learning: 2025-11-24T17:58:10.392Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/UPDATE_FROM_INPUT_QUEUE.md:0-0
Timestamp: 2025-11-24T17:58:10.392Z
Learning: Applies to program-libs/batched-merkle-tree/docs/src/merkle_tree.rs : Batch nullify operations must check that tree type is TreeType::StateV2 before processing, verify batch has ready ZKP batches (num_full_zkp_batches > num_inserted_zkp_batches), and reject if batch is already in Inserted state.
Applied to files:
forester/tests/e2e_test.rs
📚 Learning: 2025-11-24T17:58:10.392Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/UPDATE_FROM_INPUT_QUEUE.md:0-0
Timestamp: 2025-11-24T17:58:10.392Z
Learning: Applies to program-libs/batched-merkle-tree/docs/src/merkle_tree.rs : In src/merkle_tree.rs, implement BatchedMerkleTreeAccount::update_tree_from_input_queue method for batch nullify operations on StateV2 trees. The method must verify ZKP proving correctness of: old_root + queue nullifiers → new_root, update tree root, increment tree sequence_number, increment tree nullifier_next_index by zkp_batch_size, mark ZKP batch as inserted, transition batch state to Inserted when all ZKP batches complete, and zero out bloom filter when current batch is 50% inserted.
Applied to files:
forester/tests/e2e_test.rs
📚 Learning: 2025-11-24T17:58:35.079Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/UPDATE_FROM_OUTPUT_QUEUE.md:0-0
Timestamp: 2025-11-24T17:58:35.079Z
Learning: Applies to program-libs/batched-merkle-tree/docs/src/merkle_tree.rs : BatchedMerkleTreeAccount must be of type `TreeType::StateV2` when updating tree from output queue
Applied to files:
forester/tests/e2e_test.rs
📚 Learning: 2025-11-24T17:57:02.558Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/INSERT_ADDRESS_QUEUE.md:0-0
Timestamp: 2025-11-24T17:57:02.558Z
Learning: Applies to program-libs/batched-merkle-tree/docs/src/merkle_tree.rs : After inserting an address into the batch, check if `num_inserted_elements == batch_size`. If true, transition batch state from `Fill` to `Full`, increment `currently_processing_batch_index` to switch to the other batch, and update `pending_batch_index` to mark this batch ready for tree update.
Applied to files:
forester/tests/e2e_test.rs
📚 Learning: 2025-11-24T17:58:35.079Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/UPDATE_FROM_OUTPUT_QUEUE.md:0-0
Timestamp: 2025-11-24T17:58:35.079Z
Learning: Applies to program-libs/batched-merkle-tree/docs/src/merkle_tree.rs : Transition batch state to `Inserted` when all ZKP batches are complete and increment `pending_batch_index` to switch to other batch
Applied to files:
forester/tests/e2e_test.rs
📚 Learning: 2025-11-24T17:57:24.369Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/INSERT_OUTPUT_QUEUE.md:0-0
Timestamp: 2025-11-24T17:57:24.369Z
Learning: Applies to program-libs/batched-merkle-tree/docs/src/queue.rs : When a batch is in `Inserted` state, clear the value vec and hash chain stores, advance batch state to `Fill`, and reset batch metadata before allowing new insertions
Applied to files:
forester/tests/e2e_test.rs
📚 Learning: 2025-11-24T17:56:00.229Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/CLAUDE.md:0-0
Timestamp: 2025-11-24T17:56:00.229Z
Learning: Applies to program-libs/batched-merkle-tree/docs/**/initialize_state_tree.rs : State tree initialization must create two Solana accounts: BatchedMerkleTreeAccount with integrated input queue and separate BatchedQueueAccount
Applied to files:
forester/tests/e2e_test.rs
📚 Learning: 2025-11-24T17:56:50.011Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/INITIALIZE_STATE_TREE.md:0-0
Timestamp: 2025-11-24T17:56:50.011Z
Learning: Applies to program-libs/batched-merkle-tree/docs/src/initialize_state_tree.rs : Initialize a state Merkle tree with a `TreeType::StateV2` (4) tree type, storing tree roots, root history, and integrated input queue (bloom filters + hash chains for nullifiers) in the `BatchedMerkleTreeAccount` with discriminator b`BatchMta` [66, 97, 116, 99, 104, 77, 116, 97]
Applied to files:
forester/tests/e2e_test.rs
📚 Learning: 2025-11-24T17:56:50.011Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/INITIALIZE_STATE_TREE.md:0-0
Timestamp: 2025-11-24T17:56:50.011Z
Learning: Applies to program-libs/batched-merkle-tree/docs/src/initialize_state_tree.rs : Set state Merkle tree account discriminator to b`BatchMta` (8 bytes) and initialize tree metadata with TreeType::StateV2 (4)
Applied to files:
forester/tests/e2e_test.rs
📚 Learning: 2025-11-24T17:56:50.011Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/INITIALIZE_STATE_TREE.md:0-0
Timestamp: 2025-11-24T17:56:50.011Z
Learning: Applies to program-libs/batched-merkle-tree/docs/src/initialize_state_tree.rs : Initialize an output queue account as `BatchedQueueAccount` with `QueueType::OutputStateV2`, temporary storage for compressed account hashes before tree insertion with immediate spending capability via proof-by-index, using discriminator b`queueacc` [113, 117, 101, 117, 101, 97, 99, 99]
Applied to files:
forester/tests/e2e_test.rs
📚 Learning: 2025-11-24T17:56:50.011Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/INITIALIZE_STATE_TREE.md:0-0
Timestamp: 2025-11-24T17:56:50.011Z
Learning: Applies to program-libs/batched-merkle-tree/docs/src/initialize_state_tree.rs : Define batch size parameters in `InitStateTreeAccountsInstructionData` struct: input_queue_batch_size (u64, default 15,000), output_queue_batch_size (u64, default 15,000), input_queue_zkp_batch_size (u64, default 500), and output_queue_zkp_batch_size (u64, default 500)
Applied to files:
forester/tests/e2e_test.rs
📚 Learning: 2025-11-24T17:56:50.011Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/INITIALIZE_STATE_TREE.md:0-0
Timestamp: 2025-11-24T17:56:50.011Z
Learning: Applies to program-libs/batched-merkle-tree/docs/src/initialize_state_tree.rs : Use `check_account_balance_is_rent_exempt` function from `light-account-checks` to verify rent exemption for both queue_account and merkle_tree_account during initialization
Applied to files:
forester/tests/e2e_test.rs
📚 Learning: 2025-11-24T17:57:53.312Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/TREE_ACCOUNT.md:0-0
Timestamp: 2025-11-24T17:57:53.312Z
Learning: Applies to program-libs/batched-merkle-tree/docs/**/*.rs : State trees must initialize with zero bytes root for the specified height and have a separate BatchedQueueAccount for output operations
Applied to files:
forester/tests/e2e_test.rs
📚 Learning: 2025-11-24T17:56:50.011Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/INITIALIZE_STATE_TREE.md:0-0
Timestamp: 2025-11-24T17:56:50.011Z
Learning: Applies to program-libs/batched-merkle-tree/docs/src/initialize_state_tree.rs : Compute and store hashed pubkeys by hashing and truncating to 31 bytes for bn254 field compatibility in both queue and tree accounts
Applied to files:
forester/tests/e2e_test.rs
📚 Learning: 2025-11-24T17:57:39.230Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/QUEUE_ACCOUNT.md:0-0
Timestamp: 2025-11-24T17:57:39.230Z
Learning: Applies to program-libs/batched-merkle-tree/docs/src/queue.rs : Check `tree_capacity` (2^height) against new insertions to prevent overflow in `BatchedQueueAccount`
Applied to files:
forester/tests/e2e_test.rs
📚 Learning: 2025-11-24T17:56:50.011Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/INITIALIZE_STATE_TREE.md:0-0
Timestamp: 2025-11-24T17:56:50.011Z
Learning: Applies to program-libs/batched-merkle-tree/docs/src/initialize_state_tree.rs : Initialize output queue with 2 alternating batches, each with batch_size = output_queue_batch_size and zkp_batch_size = output_queue_zkp_batch_size
Applied to files:
forester/tests/e2e_test.rs
📚 Learning: 2025-11-24T17:56:50.011Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/INITIALIZE_STATE_TREE.md:0-0
Timestamp: 2025-11-24T17:56:50.011Z
Learning: Applies to program-libs/batched-merkle-tree/docs/src/initialize_state_tree.rs : Associate output queue with merkle_tree_account pubkey in queue metadata and calculate rollover_fee based on rollover_threshold, height, and total rent (merkle_tree_rent + additional_bytes_rent + queue_rent)
Applied to files:
forester/tests/e2e_test.rs
📚 Learning: 2025-11-24T17:56:50.011Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/INITIALIZE_STATE_TREE.md:0-0
Timestamp: 2025-11-24T17:56:50.011Z
Learning: Applies to program-libs/batched-merkle-tree/docs/src/initialize_state_tree.rs : Associate state tree with queue_account pubkey in tree metadata and set rollover_fee to 0 (charged on queue insertion, not tree operations)
Applied to files:
forester/tests/e2e_test.rs
📚 Learning: 2025-11-24T17:58:35.079Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/UPDATE_FROM_OUTPUT_QUEUE.md:0-0
Timestamp: 2025-11-24T17:58:35.079Z
Learning: Applies to program-libs/batched-merkle-tree/docs/src/merkle_tree.rs : In `src/merkle_tree.rs`, implement `BatchedMerkleTreeAccount::update_tree_from_output_queue_account` method that batch appends values from output queue to state Merkle tree with ZKP verification, verifying proof of old_root + queue_values → new_root
Applied to files:
forester/tests/e2e_test.rs
📚 Learning: 2025-11-24T17:57:24.369Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/INSERT_OUTPUT_QUEUE.md:0-0
Timestamp: 2025-11-24T17:57:24.369Z
Learning: Applies to program-libs/batched-merkle-tree/docs/src/queue.rs : Before inserting into the output queue, validate that the tree is not full by checking that next_index < tree_capacity
Applied to files:
forester/tests/e2e_test.rs
📚 Learning: 2025-11-24T17:56:00.229Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/CLAUDE.md:0-0
Timestamp: 2025-11-24T17:56:00.229Z
Learning: Applies to program-libs/batched-merkle-tree/docs/**/queue.rs : Output queue insertion must use BatchedQueueAccount::insert_into_current_batch method
Applied to files:
forester/tests/e2e_test.rs
📚 Learning: 2025-11-24T17:56:50.011Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/INITIALIZE_STATE_TREE.md:0-0
Timestamp: 2025-11-24T17:56:50.011Z
Learning: Applies to program-libs/batched-merkle-tree/docs/src/queue.rs : Store `BatchedQueueAccount` layout and `BatchedQueueMetadata` in src/queue.rs
Applied to files:
forester/tests/e2e_test.rs
📚 Learning: 2025-11-24T17:56:50.011Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/INITIALIZE_STATE_TREE.md:0-0
Timestamp: 2025-11-24T17:56:50.011Z
Learning: Applies to program-libs/batched-merkle-tree/docs/src/initialize_state_tree.rs : Initialize output queue value vectors (2 vectors, one per batch with capacity = batch_size each) and hash chain stores (2 vectors with capacity = batch_size / zkp_batch_size each)
Applied to files:
forester/tests/e2e_test.rs
📚 Learning: 2025-11-24T18:01:30.012Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-tests/CLAUDE.md:0-0
Timestamp: 2025-11-24T18:01:30.012Z
Learning: Run batched tree transfer test using `cargo test-sbf -p compressed-token-test -- test_transfer_with_photon_and_batched_tree` and apply retry logic in CI (max 3 attempts, 5s delay) due to known flakiness
Applied to files:
forester/tests/e2e_test.rs
📚 Learning: 2025-11-24T18:01:30.012Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-tests/CLAUDE.md:0-0
Timestamp: 2025-11-24T18:01:30.012Z
Learning: Run Light system program compression tests using `cargo test-sbf -p system-test -- test_with_compression` and `cargo test-sbf -p system-test --test test_re_init_cpi_account` to test compressed account operations
Applied to files:
forester/tests/e2e_test.rs
📚 Learning: 2025-11-24T17:57:39.230Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/QUEUE_ACCOUNT.md:0-0
Timestamp: 2025-11-24T17:57:39.230Z
Learning: Applies to program-libs/batched-merkle-tree/docs/src/queue.rs : Store compressed account hashes in `BatchedQueueAccount` value vectors for immediate proof-by-index access before tree insertion
Applied to files:
forester/tests/e2e_test.rs
📚 Learning: 2025-11-24T17:58:10.392Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/UPDATE_FROM_INPUT_QUEUE.md:0-0
Timestamp: 2025-11-24T17:58:10.392Z
Learning: Applies to program-libs/batched-merkle-tree/docs/src/merkle_tree.rs : Batch address append operations must check that tree type is TreeType::AddressV2 before processing, verify tree capacity constraint (tree.next_index + zkp_batch_size <= tree_capacity), verify batch has ready ZKP batches (num_full_zkp_batches > num_inserted_zkp_batches), and reject if batch is already in Inserted state.
Applied to files:
forester/tests/e2e_test.rs
📚 Learning: 2025-11-24T17:56:00.229Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/CLAUDE.md:0-0
Timestamp: 2025-11-24T17:56:00.229Z
Learning: Applies to program-libs/batched-merkle-tree/docs/**/queue.rs : Output queues must store compressed account hashes in value vectors (one per batch) enabling access by leaf index before tree insertion
Applied to files:
forester/tests/e2e_test.rs
📚 Learning: 2025-11-24T18:01:30.012Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-tests/CLAUDE.md:0-0
Timestamp: 2025-11-24T18:01:30.012Z
Learning: Run account-compression tests using `cargo test-sbf -p account-compression-test` to test core account compression program (Merkle tree management)
Applied to files:
forester/tests/e2e_test.rs
🧬 Code graph analysis (1)
forester/tests/e2e_test.rs (1)
program-libs/batched-merkle-tree/src/merkle_tree.rs (4)
BatchedMerkleTreeAccount(1080-1080)BatchedMerkleTreeAccount(1090-1090)BatchedMerkleTreeAccount(1100-1100)state_from_bytes(133-139)
🪛 GitHub Actions: lint
forester/tests/e2e_test.rs
[warning] 782-792: Code style formatting suggestion: multi-line the long panic! message for consistency with code style.
[error] 1-1: lint step failed (exit code 1). Command: 'nx run @lightprotocol/sdk-anchor-test:lint'.
🪛 GitHub Check: lint
forester/tests/e2e_test.rs
[warning] 782-782:
Diff in /home/runner/work/light-protocol/light-protocol/forester/tests/e2e_test.rs
🔇 Additional comments (2)
forester/tests/e2e_test.rs (2)
15-18: BatchState import is appropriate for queue introspectionPulling in
BatchStatehere is consistent with the new helper that inspects batch states, and keeps the test strongly typed instead of relying on raw state integers. No issues from my side.
899-901: V2 transaction gating is good, but confirm the queue-space check targets the actual output queuePlacing
wait_for_queue_space(rpc, &env.v2_state_trees[0].merkle_tree).await;at the top of the V2 branch usefully avoids hammering the program when both batches areFull, and it will reduce transientBatchNotReadyfailures.However, given the helper currently decodes a
BatchedMerkleTreeAccount, please verify that:
- The
queue_batchesit inspects are the same batches backingenv.v2_state_trees[0].output_queue(the queue you pass intocompress/ V2 transfers), and- You’re not accidentally keying off the integrated input queue for nullifiers instead of the dedicated output queue account.
If it turns out the output queue uses its own
BatchedQueueAccountwith separatequeue_batches, this call site should pass that account’s pubkey into a helper that decodesBatchedQueueAccountrather than the tree.
07129f7 to
6a1bdf0
Compare
| tokenPoolInfos, | ||
| }, | ||
| ); | ||
| await loadATA(rpc, payer, recipientAta, recipient, undefined, { |
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.
loadATA ATA is inconsistent with variable naming eg recipientAta
| * | ||
| * @return Object with mint address and transaction signature | ||
| */ | ||
| export async function createMint( |
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.
could it make sense to rename to createSplMint?
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.
if we change name it would break, its just still here to not break old consumers.
added the deprecation notice with link to createMintInterface which everyone should switch to. it allows SPL-token, token-22 and c-token
but good catch is that I need to revert the freezeAuthority position change, its here on accident
4abddc8 to
3813791
Compare
| @@ -46,7 +46,7 @@ pub fn generate_ctoken_seed_provider_implementation( | |||
| let authority_arm = quote! { | |||
| CTokenAccountVariant::#variant_name => { | |||
| Err(anchor_lang::prelude::ProgramError::Custom( | |||
| CompressibleInstructionError::AtaDoesNotUseSeedDerivation.into() | |||
| CompressibleInstructionError::ATADoesNotUseSeedDerivation.into() | |||
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.
ATA or Ata ?
cc8b2e3 to
4e636f2
Compare
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.
Actionable comments posted: 5
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (115)
.github/workflows/js-v2.ymlis excluded by none and included by nonecli/src/utils/constants.tsis excluded by none and included by nonecli/src/utils/processPhotonIndexer.tsis excluded by none and included by nonejs/compressed-token/package.jsonis excluded by none and included by nonejs/compressed-token/rollup.config.jsis excluded by none and included by nonejs/compressed-token/src/actions/approve-and-mint-to.tsis excluded by none and included by nonejs/compressed-token/src/actions/compress-spl-token-account.tsis excluded by none and included by nonejs/compressed-token/src/actions/compress.tsis excluded by none and included by nonejs/compressed-token/src/actions/create-mint.tsis excluded by none and included by nonejs/compressed-token/src/actions/create-token-pool.tsis excluded by none and included by nonejs/compressed-token/src/actions/decompress-delegated.tsis excluded by none and included by nonejs/compressed-token/src/actions/decompress.tsis excluded by none and included by nonejs/compressed-token/src/actions/mint-to.tsis excluded by none and included by nonejs/compressed-token/src/constants.tsis excluded by none and included by nonejs/compressed-token/src/index.tsis excluded by none and included by nonejs/compressed-token/src/program.tsis excluded by none and included by nonejs/compressed-token/src/types.tsis excluded by none and included by nonejs/compressed-token/src/utils/get-token-pool-infos.tsis excluded by none and included by nonejs/compressed-token/src/v3/actions/create-associated-ctoken.tsis excluded by none and included by nonejs/compressed-token/src/v3/actions/create-ata-interface.tsis excluded by none and included by nonejs/compressed-token/src/v3/actions/create-mint-interface.tsis excluded by none and included by nonejs/compressed-token/src/v3/actions/decompress-interface.tsis excluded by none and included by nonejs/compressed-token/src/v3/actions/get-or-create-ata-interface.tsis excluded by none and included by nonejs/compressed-token/src/v3/actions/index.tsis excluded by none and included by nonejs/compressed-token/src/v3/actions/load-ata.tsis excluded by none and included by nonejs/compressed-token/src/v3/actions/mint-to-compressed.tsis excluded by none and included by nonejs/compressed-token/src/v3/actions/mint-to-interface.tsis excluded by none and included by nonejs/compressed-token/src/v3/actions/mint-to.tsis excluded by none and included by nonejs/compressed-token/src/v3/actions/transfer-interface.tsis excluded by none and included by nonejs/compressed-token/src/v3/actions/unwrap.tsis excluded by none and included by nonejs/compressed-token/src/v3/actions/update-metadata.tsis excluded by none and included by nonejs/compressed-token/src/v3/actions/update-mint.tsis excluded by none and included by nonejs/compressed-token/src/v3/actions/wrap.tsis excluded by none and included by nonejs/compressed-token/src/v3/ata-utils.tsis excluded by none and included by nonejs/compressed-token/src/v3/derivation.tsis excluded by none and included by nonejs/compressed-token/src/v3/get-account-interface.tsis excluded by none and included by nonejs/compressed-token/src/v3/get-associated-token-address-interface.tsis excluded by none and included by nonejs/compressed-token/src/v3/get-mint-interface.tsis excluded by none and included by nonejs/compressed-token/src/v3/index.tsis excluded by none and included by nonejs/compressed-token/src/v3/instructions/create-associated-ctoken.tsis excluded by none and included by nonejs/compressed-token/src/v3/instructions/create-ata-interface.tsis excluded by none and included by nonejs/compressed-token/src/v3/instructions/create-decompress-interface-instruction.tsis excluded by none and included by nonejs/compressed-token/src/v3/instructions/create-load-accounts-params.tsis excluded by none and included by nonejs/compressed-token/src/v3/instructions/create-mint.tsis excluded by none and included by nonejs/compressed-token/src/v3/instructions/index.tsis excluded by none and included by nonejs/compressed-token/src/v3/instructions/mint-to-compressed.tsis excluded by none and included by nonejs/compressed-token/src/v3/instructions/mint-to-interface.tsis excluded by none and included by nonejs/compressed-token/src/v3/instructions/mint-to.tsis excluded by none and included by nonejs/compressed-token/src/v3/instructions/transfer-interface.tsis excluded by none and included by nonejs/compressed-token/src/v3/instructions/unwrap.tsis excluded by none and included by nonejs/compressed-token/src/v3/instructions/update-metadata.tsis excluded by none and included by nonejs/compressed-token/src/v3/instructions/update-mint.tsis excluded by none and included by nonejs/compressed-token/src/v3/instructions/wrap.tsis excluded by none and included by nonejs/compressed-token/src/v3/layout/index.tsis excluded by none and included by nonejs/compressed-token/src/v3/layout/layout-mint-action.tsis excluded by none and included by nonejs/compressed-token/src/v3/layout/layout-mint.tsis excluded by none and included by nonejs/compressed-token/src/v3/layout/layout-token-metadata.tsis excluded by none and included by nonejs/compressed-token/src/v3/layout/layout-transfer2.tsis excluded by none and included by nonejs/compressed-token/src/v3/layout/serde.tsis excluded by none and included by nonejs/compressed-token/src/v3/unified/index.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/compress.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/compressible-load.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/create-associated-ctoken.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/create-ata-interface.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/create-compressed-mint.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/create-mint-interface.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/create-mint.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/decompress2.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/get-account-interface.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/get-mint-interface.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/get-or-create-ata-interface.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/layout.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/load-ata-combined.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/load-ata-spl-t22.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/load-ata-standard.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/load-ata-unified.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/mint-to-compressed.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/mint-to-ctoken.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/mint-to-interface.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/mint-workflow.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/payment-flows.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/transfer-interface.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/transfer.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/unwrap.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/update-metadata.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/update-mint.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/wrap.test.tsis excluded by none and included by nonejs/compressed-token/tests/unit/derive-token-pool-info.test.tsis excluded by none and included by nonejs/compressed-token/tests/unit/get-associated-token-address-interface.test.tsis excluded by none and included by nonejs/compressed-token/tests/unit/layout-mint-action.test.tsis excluded by none and included by nonejs/compressed-token/tests/unit/layout-mint.test.tsis excluded by none and included by nonejs/compressed-token/tests/unit/layout-serde.test.tsis excluded by none and included by nonejs/compressed-token/tests/unit/layout-token-metadata.test.tsis excluded by none and included by nonejs/compressed-token/tests/unit/layout-transfer2.test.tsis excluded by none and included by nonejs/compressed-token/tests/unit/serde.test.tsis excluded by none and included by nonejs/compressed-token/tests/unit/unified-guards.test.tsis excluded by none and included by nonejs/compressed-token/tests/unit/upload.test.tsis excluded by none and included by nonejs/compressed-token/types/buffer-layout/index.d.tsis excluded by none and included by nonejs/stateless.js/package.jsonis excluded by none and included by nonejs/stateless.js/rollup.config.jsis excluded by none and included by nonejs/stateless.js/src/actions/create-account.tsis excluded by none and included by nonejs/stateless.js/src/actions/transfer.tsis excluded by none and included by nonejs/stateless.js/src/constants.tsis excluded by none and included by nonejs/stateless.js/src/rpc-interface.tsis excluded by none and included by nonejs/stateless.js/src/rpc.tsis excluded by none and included by nonejs/stateless.js/src/test-helpers/test-rpc/get-compressed-token-accounts.tsis excluded by none and included by nonejs/stateless.js/src/test-helpers/test-rpc/test-rpc.tsis excluded by none and included by nonejs/stateless.js/src/utils/get-state-tree-infos.tsis excluded by none and included by nonejs/stateless.js/src/utils/index.tsis excluded by none and included by nonejs/stateless.js/src/utils/pack-decompress.tsis excluded by none and included by nonejs/stateless.js/tests/e2e/compress.test.tsis excluded by none and included by nonejs/stateless.js/tests/e2e/interface-methods.test.tsis excluded by none and included by nonejs/stateless.js/tests/e2e/rpc-interop.test.tsis excluded by none and included by nonejs/stateless.js/tests/e2e/rpc-multi-trees.test.tsis excluded by none and included by nonepnpm-lock.yamlis excluded by!**/pnpm-lock.yamland included by none
📒 Files selected for processing (1)
ctoken_for_payments.md(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.md
📄 CodeRabbit inference engine (DOCS.md)
**/*.md: Path references in documentation must use absolute paths from repository root (e.g., program-libs/ctoken-types/src/state/solana_ctoken.rs).
Code examples in documentation must include working code snippets, show correct usage and common mistakes, add inline comments explaining key points, NOT include print/log statements unless essential, and focus on core logic without debugging output.
Serialization documentation must specify: for zero-copy uselight_zero_copy::traits::{ZeroCopyAt, ZeroCopyAtMut}withDataType::zero_copy_at(&bytes)?pattern; for Borsh useborsh::BorshDeserializewithDataType::deserialize(&mut &bytes[..])?pattern. Always specify which method to use in which context.
Cross-references in documentation should link to related documentation, reference source files with specific line numbers when relevant, and use relative links within the same crate.
Files:
ctoken_for_payments.md
🧠 Learnings (18)
📓 Common learnings
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/PACKED_ACCOUNTS.md:0-0
Timestamp: 2025-11-24T17:59:54.233Z
Learning: Applies to program-libs/account-checks/docs/program-libs/account-checks/src/**/*.rs : Provide descriptive names in ProgramPackedAccounts error messages (e.g., 'token_mint' instead of 'account')
📚 Learning: 2025-11-24T18:01:54.689Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/instructions/CLAUDE.md:0-0
Timestamp: 2025-11-24T18:01:54.689Z
Learning: Applies to programs/compressed-token/program/docs/instructions/instructions/CREATE_TOKEN_ACCOUNT.md : Create Token Account Instructions documentation must cover creation of regular and associated ctoken accounts
Applied to files:
ctoken_for_payments.md
📚 Learning: 2025-11-24T18:01:47.207Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/CLAUDE.md:0-0
Timestamp: 2025-11-24T18:01:47.207Z
Learning: Applies to programs/compressed-token/program/docs/**/*.md : Documentation should be organized with a main entry point (`../CLAUDE.md`) containing instruction index and overview, supplemented by account structure reference (`ACCOUNTS.md`) and detailed instruction documentation in `instructions/` subdirectory
Applied to files:
ctoken_for_payments.md
📚 Learning: 2025-11-24T18:01:54.689Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/instructions/CLAUDE.md:0-0
Timestamp: 2025-11-24T18:01:54.689Z
Learning: Applies to programs/compressed-token/program/docs/instructions/instructions/DECOMPRESSED_TRANSFER.md : Decompressed Transfer documentation must cover SPL-compatible transfers between decompressed accounts
Applied to files:
ctoken_for_payments.md
📚 Learning: 2025-12-07T03:17:28.794Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: sdk-tests/sdk-ctoken-test/README.md:0-0
Timestamp: 2025-12-07T03:17:28.794Z
Learning: Implement all 8 compressed token instructions: create_cmint, mint_to_ctoken, create_token_account_invoke, create_token_account_invoke_signed, create_ata_invoke, create_ata_invoke_signed, transfer_interface_invoke, and transfer_interface_invoke_signed
Applied to files:
ctoken_for_payments.md
📚 Learning: 2025-12-06T00:50:17.433Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: DOCS.md:0-0
Timestamp: 2025-12-06T00:50:17.433Z
Learning: Applies to **/docs/* : For CPI documentation include: Target program (program being called), PDA signer (seeds and bump for CPI authority), Account mapping (how accounts passed through), Data passthrough (instruction data handling), Example code (complete CPI invocation).
Applied to files:
ctoken_for_payments.md
📚 Learning: 2025-11-24T18:01:54.689Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/instructions/CLAUDE.md:0-0
Timestamp: 2025-11-24T18:01:54.689Z
Learning: Applies to programs/compressed-token/program/docs/instructions/instructions/**/*.md : Instruction documentation must include the following sections: path, description (including accounts and state layout), instruction_data, Accounts (in order with checks), instruction logic and checks, and Errors (with descriptions of causes)
Applied to files:
ctoken_for_payments.md
📚 Learning: 2025-11-24T18:01:54.689Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/instructions/CLAUDE.md:0-0
Timestamp: 2025-11-24T18:01:54.689Z
Learning: Applies to programs/compressed-token/program/docs/instructions/instructions/CLOSE_TOKEN_ACCOUNT.md : Close Token Account documentation must cover closing decompressed token accounts with rent distribution
Applied to files:
ctoken_for_payments.md
📚 Learning: 2025-11-24T18:01:54.689Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/instructions/CLAUDE.md:0-0
Timestamp: 2025-11-24T18:01:54.689Z
Learning: Applies to programs/compressed-token/program/docs/instructions/**/ACCOUNTS.md : ACCOUNTS.md must contain complete account layouts and data structures with references to code paths
Applied to files:
ctoken_for_payments.md
📚 Learning: 2025-12-07T18:10:14.595Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/CLAUDE.md:0-0
Timestamp: 2025-12-07T18:10:14.595Z
Learning: Applies to programs/compressed-token/program/docs/ACCOUNTS.md : All account documentation must include: description, discriminator, state layout, serialization example, hashing (for compressed accounts only), derivation (for PDAs only), and associated instructions (create, update, close)
Applied to files:
ctoken_for_payments.md
📚 Learning: 2025-12-07T18:10:14.595Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/CLAUDE.md:0-0
Timestamp: 2025-12-07T18:10:14.595Z
Learning: Applies to programs/compressed-token/program/docs/instructions/*.md : All instruction documentation must include: path to instruction code, description of what the instruction does including accounts used and state layouts, instruction_data paths, accounts list with checks, instruction logic and checks, and possible errors with descriptions
Applied to files:
ctoken_for_payments.md
📚 Learning: 2025-11-24T17:54:38.537Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/README.md:0-0
Timestamp: 2025-11-24T17:54:38.537Z
Learning: Implement compressed token program interfaces for third-party token creation and usage on Solana using ZK Compression
Applied to files:
ctoken_for_payments.md
📚 Learning: 2025-11-24T17:54:33.614Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/anchor/README.md:0-0
Timestamp: 2025-11-24T17:54:33.614Z
Learning: Implement the Compressed Token Program interface for creating and using compressed tokens on Solana with ZK Compression
Applied to files:
ctoken_for_payments.md
📚 Learning: 2025-12-07T18:10:14.595Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/CLAUDE.md:0-0
Timestamp: 2025-12-07T18:10:14.595Z
Learning: All compressed token account implementations must reference and comply with the account layout specifications in programs/compressed-token/program/docs/ACCOUNTS.md
Applied to files:
ctoken_for_payments.md
📚 Learning: 2025-12-07T18:10:14.595Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/CLAUDE.md:0-0
Timestamp: 2025-12-07T18:10:14.595Z
Learning: Applies to programs/compressed-token/program/src/ctoken_transfer.rs : CTokenTransfer instruction (discriminator: 3) must implement SPL-compatible transfers between decompressed accounts
Applied to files:
ctoken_for_payments.md
📚 Learning: 2025-11-24T17:53:57.540Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: js/compressed-token/README.md:0-0
Timestamp: 2025-11-24T17:53:57.540Z
Learning: This is the JavaScript SDK for interacting with the Compressed Token program on Solana
Applied to files:
ctoken_for_payments.md
📚 Learning: 2025-12-06T00:49:57.458Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: sdk-tests/sdk-token-test/CLAUDE.md:0-0
Timestamp: 2025-12-06T00:49:57.458Z
Learning: Applies to sdk-tests/sdk-token-test/**/*test.rs : Tests should use light-ctoken-sdk functions from sdk-libs/compressed-token-sdk for testing ctoken instructions
Applied to files:
ctoken_for_payments.md
📚 Learning: 2025-12-07T03:17:28.794Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: sdk-tests/sdk-ctoken-test/README.md:0-0
Timestamp: 2025-12-07T03:17:28.794Z
Learning: Use compressible token account extensions that allow accounts to be compressed back into compressed state with rent payment mechanisms
Applied to files:
ctoken_for_payments.md
🔇 Additional comments (1)
ctoken_for_payments.md (1)
326-326: Reconcile SPL transfer API discrepancy in Quick Reference table.The table lists
transferChecked()but the earlier examples usetransfer(). Both exist in @solana/spl-token but serve different purposes:transfer()assumes the caller trusts the mint/decimals, whiletransferChecked()validates them. Clarify which is recommended for this payment flow, or update the table to match the examples.If
transferChecked()is preferred, update the earlier examples (lines 101–113) to match. Iftransfer()is correct, update the table.
| const ata = await getOrCreateAssociatedTokenAccount( | ||
| connection, | ||
| payer, | ||
| mint, | ||
| recipient | ||
| ); | ||
| // Share ata.address with sender | ||
|
|
||
| console.log(ata.amount); | ||
| ``` |
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.
🛠️ Refactor suggestion | 🟠 Major
Add inline comments explaining the idempotent creation pattern.
The SPL example shows getOrCreateAssociatedTokenAccount but doesn't explain what "idempotent" means or why this pattern matters. This is key to understanding why the c-token equivalent is valuable. Add a comment explaining that this function safely creates the ATA if it doesn't exist, or returns it if it already does.
// Safe account creation: creates ATA if missing, returns existing ATA if present
const ata = await getOrCreateAssociatedTokenAccount(
connection,
payer,
mint,
recipient
);
// Use ata.address to share with sender (existing or newly created)🤖 Prompt for AI Agents
In ctoken_for_payments.md around lines 32 to 41, the example using
getOrCreateAssociatedTokenAccount lacks an inline explanation of the idempotent
creation pattern; add a concise comment before the call stating that this helper
will create the associated token account only if it doesn't exist and otherwise
return the existing account (so repeated calls are safe), and add a short
follow-up comment clarifying that ata.address can be shared with the sender
regardless of whether the account was newly created or already present.
| ); | ||
| // Share ata.address with sender | ||
|
|
||
| console.log(ata.amount); |
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.
Remove console.log() statements from code examples.
Per coding guidelines, code examples should NOT include print/log statements unless essential. These are demo artifacts and distract from core logic. Remove or clearly mark as optional debugging statements.
Affected lines: 40 (console.log(ata.amount)), 69 (console.log(ata.parsed.amount)), 229-230 (SPL balance), 239 (c-token balance), 249 (tx history), 256-260 (merged results).
Suggested approach: Either remove these lines entirely or preface them with a comment like // Optional: log to console to indicate they're not part of the core flow.
-console.log(ata.amount);
+// Account object retrieved; use ata.amount to access token balanceAlso applies to: 69-69, 229-230, 239-239, 249-249, 256-260
🤖 Prompt for AI Agents
In ctoken_for_payments.md around lines 40, 69, 229-230, 239, 249, and 256-260,
remove the incidental console.log() statements (ata.amount, ata.parsed.amount,
SPL balance, c-token balance, tx history, and merged results) or convert them
into clearly marked optional debug lines by prefixing with a comment like "//
Optional: log to console" so examples show only core logic; ensure the examples
remain functional after removal and update surrounding text if it references
those logs.
| const tx = new Transaction().add( | ||
| ...(await createLoadAtaInstructions( | ||
| rpc, | ||
| sourceAta, | ||
| owner.publicKey, | ||
| mint, | ||
| payer.publicKey | ||
| )), | ||
| createTransferInterfaceInstruction( | ||
| sourceAta, | ||
| destinationAta, | ||
| owner.publicKey, | ||
| amount | ||
| ) | ||
| ); | ||
| ``` |
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.
🛠️ Refactor suggestion | 🟠 Major
Add inline comments explaining the instruction-level ATA loading pattern.
The createLoadAtaInstructions call is not self-explanatory. Add context about why this is needed: it loads the compressed ATA data on-chain so the transfer instruction can read it. This is necessary only at instruction-level; the high-level transferInterface handles this internally.
const tx = new Transaction().add(
// Load ATA data on-chain for the transfer instruction to consume
...(await createLoadAtaInstructions(
rpc,
sourceAta,
owner.publicKey,
mint,
payer.publicKey
)),
// Perform the actual transfer
createTransferInterfaceInstruction(
sourceAta,
destinationAta,
owner.publicKey,
amount
)
);🤖 Prompt for AI Agents
In ctoken_for_payments.md around lines 161–176 the call to
createLoadAtaInstructions is not documented and readers may not understand why
ATA data is loaded at instruction-level; add an inline comment before the spread
that explains it loads the compressed ATA data on-chain so the following
transfer instruction can read it (this is necessary only when constructing
instruction-level transfers; the high-level transferInterface handles ATA
loading internally), and add a short comment before
createTransferInterfaceInstruction indicating that the next instruction performs
the actual transfer.
| const result = await rpc.getSignaturesForOwnerInterface(owner); | ||
|
|
||
| console.log(result.signatures); // Merged + deduplicated | ||
| console.log(result.solana); // On-chain txs only | ||
| console.log(result.compressed); // Compressed txs only |
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.
Remove console.log() output from transaction history example; add guidance on when to use owner vs. address history.
See earlier comment on console.log removal. Additionally, add context on why you might use getSignaturesForAddressInterface(address) vs. getSignaturesForOwnerInterface(owner): the former gives history for a specific ATA, the latter gives all compressed transactions for an owner across all ATAs.
// Merged + deduplicated signatures (on-chain + compressed)
const result = await rpc.getSignaturesForOwnerInterface(owner);
// Use result.signatures for all activity, result.solana for on-chain only, result.compressed for compressed only🤖 Prompt for AI Agents
In ctoken_for_payments.md around lines 256 to 260, remove the three console.log
statements showing result.signatures/result.solana/result.compressed and replace
them with a short explanatory comment; also add a one-line guidance clarifying
when to use getSignaturesForAddressInterface(address) (to fetch history for a
specific ATA) versus getSignaturesForOwnerInterface(owner) (to fetch all
compressed transactions for an owner across all ATAs), and indicate that
result.signatures is the merged/deduplicated set while result.solana and
result.compressed are on-chain-only and compressed-only respectively.
| const splInterfaceInfos = await getSplInterfaceInfos(rpc, mint); | ||
| const splInterfaceInfo = splInterfaceInfos.find((i) => i.isInitialized); |
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.
🛠️ Refactor suggestion | 🟠 Major
Add inline comments explaining the getSplInterfaceInfos lookup pattern.
The pattern of fetching splInterfaceInfos and finding the initialized one is opaque. Explain: SPL interface infos represent the underlying SPL token pool backing this c-token mint. Only one will be initialized; we fetch it to pass to the unwrap instruction so it knows which SPL account to transfer to.
// Fetch SPL interface info for this mint (required for unwrap)
const splInterfaceInfos = await getSplInterfaceInfos(rpc, mint);
// Use the initialized SPL interface info (there will be only one)
const splInterfaceInfo = splInterfaceInfos.find((i) => i.isInitialized);🤖 Prompt for AI Agents
In ctoken_for_payments.md around lines 296 to 297, add brief inline comments
explaining the getSplInterfaceInfos lookup pattern: note that
getSplInterfaceInfos returns SPL interface info objects representing underlying
SPL token pools for the c-token mint, only one of which will be initialized for
this mint, and that we select the initialized entry to pass into the unwrap
instruction so it knows which SPL account to transfer to; update the two lines
to include those explanatory comments directly above or on the same line.
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.
Actionable comments posted: 4
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (115)
.github/workflows/js-v2.ymlis excluded by none and included by nonecli/src/utils/constants.tsis excluded by none and included by nonecli/src/utils/processPhotonIndexer.tsis excluded by none and included by nonejs/compressed-token/package.jsonis excluded by none and included by nonejs/compressed-token/rollup.config.jsis excluded by none and included by nonejs/compressed-token/src/actions/approve-and-mint-to.tsis excluded by none and included by nonejs/compressed-token/src/actions/compress-spl-token-account.tsis excluded by none and included by nonejs/compressed-token/src/actions/compress.tsis excluded by none and included by nonejs/compressed-token/src/actions/create-mint.tsis excluded by none and included by nonejs/compressed-token/src/actions/create-token-pool.tsis excluded by none and included by nonejs/compressed-token/src/actions/decompress-delegated.tsis excluded by none and included by nonejs/compressed-token/src/actions/decompress.tsis excluded by none and included by nonejs/compressed-token/src/actions/mint-to.tsis excluded by none and included by nonejs/compressed-token/src/constants.tsis excluded by none and included by nonejs/compressed-token/src/index.tsis excluded by none and included by nonejs/compressed-token/src/program.tsis excluded by none and included by nonejs/compressed-token/src/types.tsis excluded by none and included by nonejs/compressed-token/src/utils/get-token-pool-infos.tsis excluded by none and included by nonejs/compressed-token/src/v3/actions/create-associated-ctoken.tsis excluded by none and included by nonejs/compressed-token/src/v3/actions/create-ata-interface.tsis excluded by none and included by nonejs/compressed-token/src/v3/actions/create-mint-interface.tsis excluded by none and included by nonejs/compressed-token/src/v3/actions/decompress-interface.tsis excluded by none and included by nonejs/compressed-token/src/v3/actions/get-or-create-ata-interface.tsis excluded by none and included by nonejs/compressed-token/src/v3/actions/index.tsis excluded by none and included by nonejs/compressed-token/src/v3/actions/load-ata.tsis excluded by none and included by nonejs/compressed-token/src/v3/actions/mint-to-compressed.tsis excluded by none and included by nonejs/compressed-token/src/v3/actions/mint-to-interface.tsis excluded by none and included by nonejs/compressed-token/src/v3/actions/mint-to.tsis excluded by none and included by nonejs/compressed-token/src/v3/actions/transfer-interface.tsis excluded by none and included by nonejs/compressed-token/src/v3/actions/unwrap.tsis excluded by none and included by nonejs/compressed-token/src/v3/actions/update-metadata.tsis excluded by none and included by nonejs/compressed-token/src/v3/actions/update-mint.tsis excluded by none and included by nonejs/compressed-token/src/v3/actions/wrap.tsis excluded by none and included by nonejs/compressed-token/src/v3/ata-utils.tsis excluded by none and included by nonejs/compressed-token/src/v3/derivation.tsis excluded by none and included by nonejs/compressed-token/src/v3/get-account-interface.tsis excluded by none and included by nonejs/compressed-token/src/v3/get-associated-token-address-interface.tsis excluded by none and included by nonejs/compressed-token/src/v3/get-mint-interface.tsis excluded by none and included by nonejs/compressed-token/src/v3/index.tsis excluded by none and included by nonejs/compressed-token/src/v3/instructions/create-associated-ctoken.tsis excluded by none and included by nonejs/compressed-token/src/v3/instructions/create-ata-interface.tsis excluded by none and included by nonejs/compressed-token/src/v3/instructions/create-decompress-interface-instruction.tsis excluded by none and included by nonejs/compressed-token/src/v3/instructions/create-load-accounts-params.tsis excluded by none and included by nonejs/compressed-token/src/v3/instructions/create-mint.tsis excluded by none and included by nonejs/compressed-token/src/v3/instructions/index.tsis excluded by none and included by nonejs/compressed-token/src/v3/instructions/mint-to-compressed.tsis excluded by none and included by nonejs/compressed-token/src/v3/instructions/mint-to-interface.tsis excluded by none and included by nonejs/compressed-token/src/v3/instructions/mint-to.tsis excluded by none and included by nonejs/compressed-token/src/v3/instructions/transfer-interface.tsis excluded by none and included by nonejs/compressed-token/src/v3/instructions/unwrap.tsis excluded by none and included by nonejs/compressed-token/src/v3/instructions/update-metadata.tsis excluded by none and included by nonejs/compressed-token/src/v3/instructions/update-mint.tsis excluded by none and included by nonejs/compressed-token/src/v3/instructions/wrap.tsis excluded by none and included by nonejs/compressed-token/src/v3/layout/index.tsis excluded by none and included by nonejs/compressed-token/src/v3/layout/layout-mint-action.tsis excluded by none and included by nonejs/compressed-token/src/v3/layout/layout-mint.tsis excluded by none and included by nonejs/compressed-token/src/v3/layout/layout-token-metadata.tsis excluded by none and included by nonejs/compressed-token/src/v3/layout/layout-transfer2.tsis excluded by none and included by nonejs/compressed-token/src/v3/layout/serde.tsis excluded by none and included by nonejs/compressed-token/src/v3/unified/index.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/compress.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/compressible-load.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/create-associated-ctoken.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/create-ata-interface.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/create-compressed-mint.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/create-mint-interface.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/create-mint.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/decompress2.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/get-account-interface.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/get-mint-interface.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/get-or-create-ata-interface.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/layout.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/load-ata-combined.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/load-ata-spl-t22.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/load-ata-standard.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/load-ata-unified.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/mint-to-compressed.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/mint-to-ctoken.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/mint-to-interface.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/mint-workflow.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/payment-flows.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/transfer-interface.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/transfer.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/unwrap.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/update-metadata.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/update-mint.test.tsis excluded by none and included by nonejs/compressed-token/tests/e2e/wrap.test.tsis excluded by none and included by nonejs/compressed-token/tests/unit/derive-token-pool-info.test.tsis excluded by none and included by nonejs/compressed-token/tests/unit/get-associated-token-address-interface.test.tsis excluded by none and included by nonejs/compressed-token/tests/unit/layout-mint-action.test.tsis excluded by none and included by nonejs/compressed-token/tests/unit/layout-mint.test.tsis excluded by none and included by nonejs/compressed-token/tests/unit/layout-serde.test.tsis excluded by none and included by nonejs/compressed-token/tests/unit/layout-token-metadata.test.tsis excluded by none and included by nonejs/compressed-token/tests/unit/layout-transfer2.test.tsis excluded by none and included by nonejs/compressed-token/tests/unit/serde.test.tsis excluded by none and included by nonejs/compressed-token/tests/unit/unified-guards.test.tsis excluded by none and included by nonejs/compressed-token/tests/unit/upload.test.tsis excluded by none and included by nonejs/compressed-token/types/buffer-layout/index.d.tsis excluded by none and included by nonejs/stateless.js/package.jsonis excluded by none and included by nonejs/stateless.js/rollup.config.jsis excluded by none and included by nonejs/stateless.js/src/actions/create-account.tsis excluded by none and included by nonejs/stateless.js/src/actions/transfer.tsis excluded by none and included by nonejs/stateless.js/src/constants.tsis excluded by none and included by nonejs/stateless.js/src/rpc-interface.tsis excluded by none and included by nonejs/stateless.js/src/rpc.tsis excluded by none and included by nonejs/stateless.js/src/test-helpers/test-rpc/get-compressed-token-accounts.tsis excluded by none and included by nonejs/stateless.js/src/test-helpers/test-rpc/test-rpc.tsis excluded by none and included by nonejs/stateless.js/src/utils/get-state-tree-infos.tsis excluded by none and included by nonejs/stateless.js/src/utils/index.tsis excluded by none and included by nonejs/stateless.js/src/utils/pack-decompress.tsis excluded by none and included by nonejs/stateless.js/tests/e2e/compress.test.tsis excluded by none and included by nonejs/stateless.js/tests/e2e/interface-methods.test.tsis excluded by none and included by nonejs/stateless.js/tests/e2e/rpc-interop.test.tsis excluded by none and included by nonejs/stateless.js/tests/e2e/rpc-multi-trees.test.tsis excluded by none and included by nonepnpm-lock.yamlis excluded by!**/pnpm-lock.yamland included by none
📒 Files selected for processing (1)
ctoken_for_payments.md(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.md
📄 CodeRabbit inference engine (DOCS.md)
**/*.md: Path references in documentation must use absolute paths from repository root (e.g., program-libs/ctoken-types/src/state/solana_ctoken.rs).
Code examples in documentation must include working code snippets, show correct usage and common mistakes, add inline comments explaining key points, NOT include print/log statements unless essential, and focus on core logic without debugging output.
Serialization documentation must specify: for zero-copy uselight_zero_copy::traits::{ZeroCopyAt, ZeroCopyAtMut}withDataType::zero_copy_at(&bytes)?pattern; for Borsh useborsh::BorshDeserializewithDataType::deserialize(&mut &bytes[..])?pattern. Always specify which method to use in which context.
Cross-references in documentation should link to related documentation, reference source files with specific line numbers when relevant, and use relative links within the same crate.
Files:
ctoken_for_payments.md
🧠 Learnings (17)
📓 Common learnings
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/PACKED_ACCOUNTS.md:0-0
Timestamp: 2025-11-24T17:59:54.233Z
Learning: Applies to program-libs/account-checks/docs/program-libs/account-checks/src/**/*.rs : Provide descriptive names in ProgramPackedAccounts error messages (e.g., 'token_mint' instead of 'account')
📚 Learning: 2025-11-24T18:01:54.689Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/instructions/CLAUDE.md:0-0
Timestamp: 2025-11-24T18:01:54.689Z
Learning: Applies to programs/compressed-token/program/docs/instructions/instructions/CREATE_TOKEN_ACCOUNT.md : Create Token Account Instructions documentation must cover creation of regular and associated ctoken accounts
Applied to files:
ctoken_for_payments.md
📚 Learning: 2025-11-24T18:01:47.207Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/CLAUDE.md:0-0
Timestamp: 2025-11-24T18:01:47.207Z
Learning: Applies to programs/compressed-token/program/docs/**/*.md : Documentation should be organized with a main entry point (`../CLAUDE.md`) containing instruction index and overview, supplemented by account structure reference (`ACCOUNTS.md`) and detailed instruction documentation in `instructions/` subdirectory
Applied to files:
ctoken_for_payments.md
📚 Learning: 2025-11-24T18:01:54.689Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/instructions/CLAUDE.md:0-0
Timestamp: 2025-11-24T18:01:54.689Z
Learning: Applies to programs/compressed-token/program/docs/instructions/instructions/DECOMPRESSED_TRANSFER.md : Decompressed Transfer documentation must cover SPL-compatible transfers between decompressed accounts
Applied to files:
ctoken_for_payments.md
📚 Learning: 2025-12-06T00:50:17.433Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: DOCS.md:0-0
Timestamp: 2025-12-06T00:50:17.433Z
Learning: Applies to **/docs/* : For CPI documentation include: Target program (program being called), PDA signer (seeds and bump for CPI authority), Account mapping (how accounts passed through), Data passthrough (instruction data handling), Example code (complete CPI invocation).
Applied to files:
ctoken_for_payments.md
📚 Learning: 2025-11-24T18:01:54.689Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/instructions/CLAUDE.md:0-0
Timestamp: 2025-11-24T18:01:54.689Z
Learning: Applies to programs/compressed-token/program/docs/instructions/instructions/**/*.md : Instruction documentation must include the following sections: path, description (including accounts and state layout), instruction_data, Accounts (in order with checks), instruction logic and checks, and Errors (with descriptions of causes)
Applied to files:
ctoken_for_payments.md
📚 Learning: 2025-12-07T18:10:14.595Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/CLAUDE.md:0-0
Timestamp: 2025-12-07T18:10:14.595Z
Learning: Applies to programs/compressed-token/program/docs/instructions/*.md : All instruction documentation must include: path to instruction code, description of what the instruction does including accounts used and state layouts, instruction_data paths, accounts list with checks, instruction logic and checks, and possible errors with descriptions
Applied to files:
ctoken_for_payments.md
📚 Learning: 2025-11-24T18:01:54.689Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/instructions/CLAUDE.md:0-0
Timestamp: 2025-11-24T18:01:54.689Z
Learning: Applies to programs/compressed-token/program/docs/instructions/instructions/CLOSE_TOKEN_ACCOUNT.md : Close Token Account documentation must cover closing decompressed token accounts with rent distribution
Applied to files:
ctoken_for_payments.md
📚 Learning: 2025-11-24T18:01:54.689Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/instructions/CLAUDE.md:0-0
Timestamp: 2025-11-24T18:01:54.689Z
Learning: Applies to programs/compressed-token/program/docs/instructions/**/ACCOUNTS.md : ACCOUNTS.md must contain complete account layouts and data structures with references to code paths
Applied to files:
ctoken_for_payments.md
📚 Learning: 2025-12-07T03:17:28.794Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: sdk-tests/sdk-ctoken-test/README.md:0-0
Timestamp: 2025-12-07T03:17:28.794Z
Learning: Implement all 8 compressed token instructions: create_cmint, mint_to_ctoken, create_token_account_invoke, create_token_account_invoke_signed, create_ata_invoke, create_ata_invoke_signed, transfer_interface_invoke, and transfer_interface_invoke_signed
Applied to files:
ctoken_for_payments.md
📚 Learning: 2025-11-24T17:54:38.537Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/README.md:0-0
Timestamp: 2025-11-24T17:54:38.537Z
Learning: Implement compressed token program interfaces for third-party token creation and usage on Solana using ZK Compression
Applied to files:
ctoken_for_payments.md
📚 Learning: 2025-11-24T17:54:33.614Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/anchor/README.md:0-0
Timestamp: 2025-11-24T17:54:33.614Z
Learning: Implement the Compressed Token Program interface for creating and using compressed tokens on Solana with ZK Compression
Applied to files:
ctoken_for_payments.md
📚 Learning: 2025-12-07T18:10:14.595Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/CLAUDE.md:0-0
Timestamp: 2025-12-07T18:10:14.595Z
Learning: All compressed token account implementations must reference and comply with the account layout specifications in programs/compressed-token/program/docs/ACCOUNTS.md
Applied to files:
ctoken_for_payments.md
📚 Learning: 2025-12-07T18:10:14.595Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/CLAUDE.md:0-0
Timestamp: 2025-12-07T18:10:14.595Z
Learning: Applies to programs/compressed-token/program/src/ctoken_transfer.rs : CTokenTransfer instruction (discriminator: 3) must implement SPL-compatible transfers between decompressed accounts
Applied to files:
ctoken_for_payments.md
📚 Learning: 2025-11-24T17:53:57.540Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: js/compressed-token/README.md:0-0
Timestamp: 2025-11-24T17:53:57.540Z
Learning: This is the JavaScript SDK for interacting with the Compressed Token program on Solana
Applied to files:
ctoken_for_payments.md
📚 Learning: 2025-12-06T00:49:57.458Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: sdk-tests/sdk-token-test/CLAUDE.md:0-0
Timestamp: 2025-12-06T00:49:57.458Z
Learning: Applies to sdk-tests/sdk-token-test/**/*test.rs : Tests should use light-ctoken-sdk functions from sdk-libs/compressed-token-sdk for testing ctoken instructions
Applied to files:
ctoken_for_payments.md
📚 Learning: 2025-12-07T03:17:28.794Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: sdk-tests/sdk-ctoken-test/README.md:0-0
Timestamp: 2025-12-07T03:17:28.794Z
Learning: Use compressible token account extensions that allow accounts to be compressed back into compressed state with rent payment mechanisms
Applied to files:
ctoken_for_payments.md
🔇 Additional comments (2)
ctoken_for_payments.md (2)
100-130: Verify file existence and SPL API usage before proceeding.The file
ctoken_for_payments.mdcould not be located in the repository. Please confirm:
- The correct file path and name
- Whether the file has been committed to version control
Regarding the SPL Token API concern: Both
transfer()andtransferChecked()exist in @solana/spl-token. Thetransfer()function operates on pre-validated tokens and takes 7 parameters (connection, payer, source, destination, owner, amount, decimals), whiletransferChecked()adds mint validation. If both functions are used in the documentation, ensure consistency with best practices—transferChecked()is recommended for security when the mint must be validated.For
createLoadAtaInstructions(): If this function appears in the c-token examples without explanation, add an inline comment clarifying its purpose and why it's necessary for c-token transfers but not SPL.
269-316: Verify file location and path; the referenced ctoken_for_payments.md does not exist in the repository.The file
ctoken_for_payments.mdat lines 269-316 could not be located in the repository through any search method. Before the concerns can be properly addressed, please confirm:
- The correct file path or name (currently appears as
ctoken_for_payments.md)- Whether this file is new and only exists in staging or the PR
- If the section reference is intended for a different documentation file (e.g., DOCS.md in
programs/compressed-token/program/)Once the file is located, the review's concerns about prerequisite documentation, error handling in code examples, and account/interface details should be addressed per the documentation standards in learnings.
| # Using c-token for Payments | ||
|
|
||
| **TL;DR**: Same API patterns, 1/200th ATA creation cost. Your users get the same USDC, just stored more efficiently. | ||
|
|
||
| --- | ||
|
|
||
| ## Setup | ||
|
|
||
| ```typescript | ||
| import { createRpc } from "@lightprotocol/stateless.js"; | ||
|
|
||
| import { | ||
| getOrCreateAtaInterface, | ||
| getAtaInterface, | ||
| getAssociatedTokenAddressInterface, | ||
| transferInterface, | ||
| unwrap, | ||
| } from "@lightprotocol/compressed-token/unified"; | ||
|
|
||
| const rpc = createRpc(RPC_ENDPOINT); | ||
| ``` |
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.
🛠️ Refactor suggestion | 🟠 Major
Add cross-references and explain key concepts in the introduction.
The documentation lacks connection to related docs and explanation of foundational concepts. Per the codebase documentation structure, this guide should reference:
- The main compressed token documentation (if it exists at
programs/compressed-token/program/docs/CLAUDE.mdor similar) - Account structure documentation for context on why unified patterns matter
- A brief explanation of what "1/200th ATA creation cost" means (ZK compression benefit?)
Additionally, the setup imports should include brief inline comments explaining each function's purpose, or cross-reference an API reference document.
Consider adding:
- A "See Also" section linking to related docs (ACCOUNTS.md, main compressed-token docs, instruction reference)
- A one-sentence explanation of the cost reduction benefit upfront
- Brief comments in the imports block explaining what each function does
🤖 Prompt for AI Agents
In ctoken_for_payments.md around lines 1 to 21, the intro and setup lack
cross-references and explanations of key concepts; add links to the main
compressed-token docs (e.g., programs/compressed-token/program/docs/CLAUDE.md or
the actual path in the repo), the accounts/account-structure doc (ACCOUNTS.md),
and the instruction/API reference, add a one-sentence explanation of what
"1/200th ATA creation cost" means (briefly describe that compressed-token
reduces on-chain ATA creation overhead via ZK/compression techniques), and
annotate the import block with short inline comments for each function (one-line
purpose for getOrCreateAtaInterface, getAtaInterface,
getAssociatedTokenAddressInterface, transferInterface, unwrap) plus a new "See
Also" section linking the referenced docs.
| # Using c-token for Payments | ||
|
|
||
| **TL;DR**: Same API patterns, 1/200th ATA creation cost. Your users get the same USDC, just stored more efficiently. | ||
|
|
||
| --- | ||
|
|
||
| ## Setup | ||
|
|
||
| ```typescript | ||
| import { createRpc } from "@lightprotocol/stateless.js"; | ||
|
|
||
| import { | ||
| getOrCreateAtaInterface, | ||
| getAtaInterface, | ||
| getAssociatedTokenAddressInterface, | ||
| transferInterface, | ||
| unwrap, | ||
| } from "@lightprotocol/compressed-token/unified"; | ||
|
|
||
| const rpc = createRpc(RPC_ENDPOINT); | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## 1. Receive Payments | ||
|
|
||
| **SPL Token:** | ||
|
|
||
| ```typescript | ||
| import { getOrCreateAssociatedTokenAccount } from "@solana/spl-token"; | ||
|
|
||
| const ata = await getOrCreateAssociatedTokenAccount( | ||
| connection, | ||
| payer, | ||
| mint, | ||
| recipient | ||
| ); | ||
| // Share ata.address with sender | ||
|
|
||
| console.log(ata.amount); | ||
| ``` | ||
|
|
||
| **SPL Token (instruction-level):** | ||
|
|
||
| ```typescript | ||
| import { | ||
| getAssociatedTokenAddressSync, | ||
| createAssociatedTokenAccountIdempotentInstruction, | ||
| } from "@solana/spl-token"; | ||
|
|
||
| const ata = getAssociatedTokenAddressSync(mint, recipient); | ||
|
|
||
| const tx = new Transaction().add( | ||
| createAssociatedTokenAccountIdempotentInstruction( | ||
| payer.publicKey, | ||
| ata, | ||
| recipient, | ||
| mint | ||
| ) | ||
| ); | ||
| ``` | ||
|
|
||
| **c-token:** | ||
|
|
||
| ```typescript | ||
| const ata = await getOrCreateAtaInterface(rpc, payer, mint, recipient); | ||
| // Share ata.parsed.address with sender | ||
|
|
||
| console.log(ata.parsed.amount); | ||
| ``` | ||
|
|
||
| **c-token (instruction-level):** | ||
|
|
||
| ```typescript | ||
| import { | ||
| createAssociatedTokenAccountInterfaceIdempotentInstruction, | ||
| getAssociatedTokenAddressInterface, | ||
| } from "@lightprotocol/compressed-token/unified"; | ||
| import { CTOKEN_PROGRAM_ID } from "@lightprotocol/stateless.js"; | ||
|
|
||
| const ata = getAssociatedTokenAddressInterface(mint, recipient); | ||
|
|
||
| const tx = new Transaction().add( | ||
| createAssociatedTokenAccountInterfaceIdempotentInstruction( | ||
| payer.publicKey, | ||
| ata, | ||
| recipient, | ||
| mint, | ||
| CTOKEN_PROGRAM_ID | ||
| ) | ||
| ); | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## 2. Send Payments | ||
|
|
||
| **SPL Token:** | ||
|
|
||
| ```typescript | ||
| import { transfer } from "@solana/spl-token"; | ||
| const sourceAta = getAssociatedTokenAddressSync(mint, owner.publicKey); | ||
| const destinationAta = getAssociatedTokenAddressSync(mint, recipient); | ||
|
|
||
| await transfer( | ||
| connection, | ||
| payer, | ||
| sourceAta, | ||
| destinationAta, | ||
| owner, | ||
| amount, | ||
| decimals | ||
| ); | ||
| ``` | ||
|
|
||
| **SPL Token (instruction-level):** | ||
|
|
||
| ```typescript | ||
| import { | ||
| getAssociatedTokenAddressSync, | ||
| createTransferInstruction, | ||
| } from "@solana/spl-token"; | ||
|
|
||
| const sourceAta = getAssociatedTokenAddressSync(mint, owner.publicKey); | ||
| const destinationAta = getAssociatedTokenAddressSync(mint, recipient); | ||
|
|
||
| const tx = new Transaction().add( | ||
| createTransferInstruction(sourceAta, destinationAta, owner.publicKey, amount) | ||
| ); | ||
| ``` | ||
|
|
||
| **c-token:** | ||
|
|
||
| ```typescript | ||
| const sourceAta = getAssociatedTokenAddressInterface(mint, owner.publicKey); | ||
| const destinationAta = getAssociatedTokenAddressInterface(mint, recipient); | ||
|
|
||
| await transferInterface( | ||
| rpc, | ||
| payer, | ||
| sourceAta, | ||
| mint, | ||
| destinationAta, | ||
| owner, | ||
| amount | ||
| ); | ||
| ``` | ||
|
|
||
| **c-token (instruction-level):** | ||
|
|
||
| ```typescript | ||
| import { | ||
| createLoadAtaInstructions, | ||
| createTransferInterfaceInstruction, | ||
| getAssociatedTokenAddressInterface, | ||
| } from "@lightprotocol/compressed-token/unified"; | ||
|
|
||
| const sourceAta = getAssociatedTokenAddressInterface(mint, owner.publicKey); | ||
| const destinationAta = getAssociatedTokenAddressInterface(mint, recipient); | ||
|
|
||
| const tx = new Transaction().add( | ||
| ...(await createLoadAtaInstructions( | ||
| rpc, | ||
| sourceAta, | ||
| owner.publicKey, | ||
| mint, | ||
| payer.publicKey | ||
| )), | ||
| createTransferInterfaceInstruction( | ||
| sourceAta, | ||
| destinationAta, | ||
| owner.publicKey, | ||
| amount | ||
| ) | ||
| ); | ||
| ``` | ||
|
|
||
| To ensure your recipient's ATA exists you can prepend an idempotent creation instruction in the same atomic transaction: | ||
|
|
||
| **SPL Token:** | ||
|
|
||
| ```typescript | ||
| import { | ||
| getAssociatedTokenAddressSync, | ||
| createAssociatedTokenAccountIdempotentInstruction, | ||
| } from "@solana/spl-token"; | ||
|
|
||
| const destinationAta = getAssociatedTokenAddressSync(mint, recipient); | ||
| const createAtaIx = createAssociatedTokenAccountIdempotentInstruction( | ||
| payer.publicKey, | ||
| destinationAta, | ||
| recipient, | ||
| mint | ||
| ); | ||
|
|
||
| new Transaction().add(createAtaIx, transferIx); | ||
| ``` | ||
|
|
||
| **c-token:** | ||
|
|
||
| ```typescript | ||
| import { | ||
| getAssociatedTokenAddressInterface, | ||
| createAssociatedTokenAccountInterfaceIdempotentInstruction, | ||
| } from "@lightprotocol/compressed-token/unified"; | ||
| import { CTOKEN_PROGRAM_ID } from "@lightprotocol/stateless.js"; | ||
|
|
||
| const destinationAta = getAssociatedTokenAddressInterface(mint, recipient); | ||
| const createAtaIx = createAssociatedTokenAccountInterfaceIdempotentInstruction( | ||
| payer.publicKey, | ||
| destinationAta, | ||
| recipient, | ||
| mint, | ||
| CTOKEN_PROGRAM_ID | ||
| ); | ||
|
|
||
| new Transaction().add(createAtaIx, transferIx); | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## 3. Show Balance | ||
|
|
||
| **SPL Token:** | ||
|
|
||
| ```typescript | ||
| import { getAccount } from "@solana/spl-token"; | ||
|
|
||
| const account = await getAccount(connection, ata); | ||
| console.log(account.amount); | ||
| ``` | ||
|
|
||
| **c-token:** | ||
|
|
||
| ```typescript | ||
| const ata = getAssociatedTokenAddressInterface(mint, owner); | ||
| const account = await getAtaInterface(rpc, ata, owner, mint); | ||
|
|
||
| console.log(account.parsed.amount); | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## 4. Transaction History | ||
|
|
||
| **SPL Token:** | ||
|
|
||
| ```typescript | ||
| const signatures = await connection.getSignaturesForAddress(ata); | ||
| ``` | ||
|
|
||
| **c-token:** | ||
|
|
||
| ```typescript | ||
| // Unified: fetches both on-chain and compressed tx signatures | ||
| const result = await rpc.getSignaturesForOwnerInterface(owner); | ||
|
|
||
| console.log(result.signatures); // Merged + deduplicated | ||
| console.log(result.solana); // On-chain txs only | ||
| console.log(result.compressed); // Compressed txs only | ||
| ``` | ||
|
|
||
| Use `getSignaturesForAddressInterface(address)` if you want address-specific rather than owner-wide history. | ||
|
|
||
| --- | ||
|
|
||
| ## 5. Unwrap to SPL | ||
|
|
||
| When users need vanilla SPL tokens (eg., for CEX off-ramp): | ||
|
|
||
| **c-token -> SPL ATA:** | ||
|
|
||
| ```typescript | ||
| import { getAssociatedTokenAddressSync } from "@solana/spl-token"; | ||
|
|
||
| // SPL ATA must exist | ||
| const splAta = getAssociatedTokenAddressSync(mint, owner.publicKey); | ||
|
|
||
| await unwrap(rpc, payer, owner, mint, splAta, amount); | ||
| ``` | ||
|
|
||
| **c-token (instruction-level):** | ||
|
|
||
| ```typescript | ||
| import { getAssociatedTokenAddressSync } from "@solana/spl-token"; | ||
| import { | ||
| createLoadAtaInstructions, | ||
| createUnwrapInstruction, | ||
| getAssociatedTokenAddressInterface, | ||
| } from "@lightprotocol/compressed-token/unified"; | ||
| import { getSplInterfaceInfos } from "@lightprotocol/compressed-token"; | ||
|
|
||
| const ctokenAta = getAssociatedTokenAddressInterface(mint, owner.publicKey); | ||
| const splAta = getAssociatedTokenAddressSync(mint, owner.publicKey); | ||
|
|
||
| const splInterfaceInfos = await getSplInterfaceInfos(rpc, mint); | ||
| const splInterfaceInfo = splInterfaceInfos.find((i) => i.isInitialized); | ||
|
|
||
| const tx = new Transaction().add( | ||
| ...(await createLoadAtaInstructions( | ||
| rpc, | ||
| ctokenAta, | ||
| owner.publicKey, | ||
| mint, | ||
| payer.publicKey | ||
| )), | ||
| createUnwrapInstruction( | ||
| ctokenAta, | ||
| splAta, | ||
| owner.publicKey, | ||
| mint, | ||
| amount, | ||
| splInterfaceInfo | ||
| ) | ||
| ); | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## Quick Reference | ||
|
|
||
| | Operation | SPL Token | c-token (unified) | | ||
| | -------------- | ------------------------------------- | -------------------------------------- | | ||
| | Get/Create ATA | `getOrCreateAssociatedTokenAccount()` | `getOrCreateAtaInterface()` | | ||
| | Derive ATA | `getAssociatedTokenAddress()` | `getAssociatedTokenAddressInterface()` | | ||
| | Transfer | `transferChecked()` | `transferInterface()` | | ||
| | Get Balance | `getAccount()` | `getAtaInterface()` | | ||
| | Tx History | `getSignaturesForAddress()` | `rpc.getSignaturesForOwnerInterface()` | | ||
| | Exit to SPL | N/A | `unwrap()` | | ||
|
|
||
| --- | ||
|
|
||
| Need help with integration? Reach out: [support@lightprotocol.com](mailto:support@lightprotocol.com) |
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.
🛠️ Refactor suggestion | 🟠 Major
Overall: Strong foundation, but needs API documentation, cross-references, and clearer explanations of c-token-specific patterns.
This guide does a great job side-by-side comparing SPL and c-token workflows. However, three categories of work remain:
-
Cross-reference missing docs (lines 1–21): Link to main compressed-token documentation, ACCOUNTS.md, and related instruction references. Per codebase guidelines, documentation should have a main entry point with an instruction index.
-
API documentation gaps: Functions like
getAtaInterface(),getOrCreateAtaInterface(),transferInterface(), andgetSplInterfaceInfos()are used but not documented. Add return types, error conditions, and purpose to the guide or link to an API reference. -
Explain c-token specifics (lines 45–176, 283–316): Developers migrating from SPL need to understand:
- Why c-token examples require
CTOKEN_PROGRAM_IDbut SPL doesn't - What
.parsedmeans on account objects - Why
createLoadAtaInstructions()is needed (zk state loading) - Why
splInterfaceInfois required for unwrap (and what to do if it's not found)
- Why c-token examples require
These are the blocking issues. The other comments above address specific fixes. Once addressed, this will be an excellent quick-start guide for developers.
🤖 Prompt for AI Agents
In ctoken_for_payments.md (start lines 1–21, 45–176, 283–316) add the missing
cross-references and detailed API/docs: at the top (lines 1–21) insert links to
the main compressed-token documentation, ACCOUNTS.md, and an instruction
reference/index per repo docs; for the API gaps, add short API doc blocks or
links for getAtaInterface(), getOrCreateAtaInterface(), transferInterface(),
createLoadAtaInstructions(), getSplInterfaceInfos(), unwrap() that list return
types, possible errors/edge cases, and intended usage (or point to the canonical
API reference); in the c-token explanation sections (lines 45–176 and 283–316)
add concise notes explaining why CTOKEN_PROGRAM_ID is required, what the .parsed
field contains, why createLoadAtaInstructions() is necessary (zk state/load
behavior), and why splInterfaceInfo is needed for unwrap (and what to do if none
found, e.g., error handling or fallback), ensuring each explanation is a couple
of sentences and includes links to deeper docs where appropriate.
| ```typescript | ||
| import { getOrCreateAssociatedTokenAccount } from "@solana/spl-token"; | ||
|
|
||
| const ata = await getOrCreateAssociatedTokenAccount( | ||
| connection, | ||
| payer, | ||
| mint, | ||
| recipient | ||
| ); | ||
| // Share ata.address with sender | ||
|
|
||
| console.log(ata.amount); | ||
| ``` | ||
|
|
||
| **SPL Token (instruction-level):** | ||
|
|
||
| ```typescript | ||
| import { | ||
| getAssociatedTokenAddressSync, | ||
| createAssociatedTokenAccountIdempotentInstruction, | ||
| } from "@solana/spl-token"; | ||
|
|
||
| const ata = getAssociatedTokenAddressSync(mint, recipient); | ||
|
|
||
| const tx = new Transaction().add( | ||
| createAssociatedTokenAccountIdempotentInstruction( | ||
| payer.publicKey, | ||
| ata, | ||
| recipient, | ||
| mint | ||
| ) | ||
| ); | ||
| ``` | ||
|
|
||
| **c-token:** | ||
|
|
||
| ```typescript | ||
| const ata = await getOrCreateAtaInterface(rpc, payer, mint, recipient); | ||
| // Share ata.parsed.address with sender | ||
|
|
||
| console.log(ata.parsed.amount); | ||
| ``` | ||
|
|
||
| **c-token (instruction-level):** | ||
|
|
||
| ```typescript | ||
| import { | ||
| createAssociatedTokenAccountInterfaceIdempotentInstruction, | ||
| getAssociatedTokenAddressInterface, | ||
| } from "@lightprotocol/compressed-token/unified"; | ||
| import { CTOKEN_PROGRAM_ID } from "@lightprotocol/stateless.js"; | ||
|
|
||
| const ata = getAssociatedTokenAddressInterface(mint, recipient); | ||
|
|
||
| const tx = new Transaction().add( | ||
| createAssociatedTokenAccountInterfaceIdempotentInstruction( | ||
| payer.publicKey, | ||
| ata, | ||
| recipient, | ||
| mint, | ||
| CTOKEN_PROGRAM_ID | ||
| ) | ||
| ); | ||
| ``` |
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.
🧩 Analysis chain
🏁 Script executed:
# Find the ctoken_for_payments.md file
find . -name "ctoken_for_payments.md" -type fRepository: Lightprotocol/light-protocol
Length of output: 96
🏁 Script executed:
# Search for getOrCreateAtaInterface implementation
rg "getOrCreateAtaInterface" --type ts --type js -B 3 -A 5Repository: Lightprotocol/light-protocol
Length of output: 220
🏁 Script executed:
# Search for createAssociatedTokenAccountInterfaceIdempotentInstruction signature
rg "createAssociatedTokenAccountInterfaceIdempotentInstruction" --type ts --type js -B 2 -A 10Repository: Lightprotocol/light-protocol
Length of output: 220
🏁 Script executed:
# Find unified API exports
find . -path "*/unified*" -type f -name "*.ts" -o -name "*.js" | head -20Repository: Lightprotocol/light-protocol
Length of output: 89
🏁 Script executed:
# Search for TokenAccount type definitions to understand .parsed structure
rg "\.parsed" --type ts --type js -B 2 -A 2 | head -100Repository: Lightprotocol/light-protocol
Length of output: 220
🏁 Script executed:
# Read the ctoken_for_payments.md file to see the actual content
cat -n ctoken_for_payments.md | sed -n '25,95p'Repository: Lightprotocol/light-protocol
Length of output: 1954
🏁 Script executed:
# Search for getOrCreateAtaInterface in all files
rg "getOrCreateAtaInterface" -B 3 -A 8 --max-count 5Repository: Lightprotocol/light-protocol
Length of output: 2214
🏁 Script executed:
# Search for createAssociatedTokenAccountInterfaceIdempotentInstruction
rg "createAssociatedTokenAccountInterfaceIdempotentInstruction" -B 2 -A 8Repository: Lightprotocol/light-protocol
Length of output: 1881
🏁 Script executed:
# List files in unified directory if it exists
find . -type d -name "unified" 2>/dev/null | head -5Repository: Lightprotocol/light-protocol
Length of output: 54
🏁 Script executed:
# Check js directory structure for API definitions
find ./js -name "*.ts" -o -name "*.js" | grep -E "(unified|index)" | head -20Repository: Lightprotocol/light-protocol
Length of output: 54
🏁 Script executed:
# Search for unified directory and API implementations
find . -type f -name "*.ts" -path "*/unified*" | head -20Repository: Lightprotocol/light-protocol
Length of output: 54
🏁 Script executed:
# Search for getOrCreateAtaInterface function definition
rg "export.*getOrCreateAtaInterface|function getOrCreateAtaInterface|const getOrCreateAtaInterface" -B 2 -A 15Repository: Lightprotocol/light-protocol
Length of output: 54
🏁 Script executed:
# Search for the return type definition
rg "interface.*AtaInterface|type.*AtaInterface" -B 2 -A 10Repository: Lightprotocol/light-protocol
Length of output: 54
🏁 Script executed:
# Look for coding guidelines document
find . -name "*.md" -path "*guide*" -o -name "GUIDELINES*" -o -name "CODING*" | grep -i guideRepository: Lightprotocol/light-protocol
Length of output: 54
🏁 Script executed:
# Check the actual structure returned - look for .parsed in code
rg "\.parsed\s*\." -B 3 -A 1 | head -50Repository: Lightprotocol/light-protocol
Length of output: 680
🏁 Script executed:
# Check if there are other examples in the file that demonstrate best practices
cat -n ctoken_for_payments.md | grep -E "(console\.|import|//) " | head -40Repository: Lightprotocol/light-protocol
Length of output: 1188
🏁 Script executed:
# Verify the file structure and see all comment examples
rg "//\s" ctoken_for_payments.md | head -20Repository: Lightprotocol/light-protocol
Length of output: 390
Remove console.log statements and add inline comments explaining API structure differences.
Lines 40 and 69 include logging without explanatory context, violating documentation guidelines. Unlike the logging at lines 258-260 (which includes comments explaining the output), these examples should either remove the console.log or add comments explaining why the logging is essential.
Additionally, the instruction-level examples (lines 73-92) need inline comments explaining:
- Why
createAssociatedTokenAccountInterfaceIdempotentInstructionrequiresCTOKEN_PROGRAM_IDas the final parameter, unlike the SPL equivalent - The purpose of the
.parsedproperty returned bygetOrCreateAtaInterface(already referenced at line 67)
🤖 Prompt for AI Agents
In ctoken_for_payments.md around lines 29 to 92, remove the bare console.log
statements at lines ~40 and ~69 and replace them with concise inline comments
that explain the API output structure (e.g., for
getOrCreateAssociatedTokenAccount / getOrCreateAtaInterface show which field
holds the address and which holds the token amount) and mirror the style used at
lines 258-260; additionally add short inline comments in the instruction-level
example (lines ~73-92) explaining why
createAssociatedTokenAccountInterfaceIdempotentInstruction requires
CTOKEN_PROGRAM_ID as the final parameter (to target the c-token program) and
what the .parsed property returned by getOrCreateAtaInterface contains and why
callers should use ata.parsed.address / ata.parsed.amount instead of ata.address
/ ata.amount.
| ## 3. Show Balance | ||
|
|
||
| **SPL Token:** | ||
|
|
||
| ```typescript | ||
| import { getAccount } from "@solana/spl-token"; | ||
|
|
||
| const account = await getAccount(connection, ata); | ||
| console.log(account.amount); | ||
| ``` | ||
|
|
||
| **c-token:** | ||
|
|
||
| ```typescript | ||
| const ata = getAssociatedTokenAddressInterface(mint, owner); | ||
| const account = await getAtaInterface(rpc, ata, owner, mint); | ||
|
|
||
| console.log(account.parsed.amount); | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## 4. Transaction History | ||
|
|
||
| **SPL Token:** | ||
|
|
||
| ```typescript | ||
| const signatures = await connection.getSignaturesForAddress(ata); | ||
| ``` | ||
|
|
||
| **c-token:** | ||
|
|
||
| ```typescript | ||
| // Unified: fetches both on-chain and compressed tx signatures | ||
| const result = await rpc.getSignaturesForOwnerInterface(owner); | ||
|
|
||
| console.log(result.signatures); // Merged + deduplicated | ||
| console.log(result.solana); // On-chain txs only | ||
| console.log(result.compressed); // Compressed txs only | ||
| ``` | ||
|
|
||
| Use `getSignaturesForAddressInterface(address)` if you want address-specific rather than owner-wide history. | ||
|
|
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.
🧩 Analysis chain
🏁 Script executed:
find . -name "ctoken_for_payments.md" -o -name "*ctoken*payments*" | head -20Repository: Lightprotocol/light-protocol
Length of output: 96
🏁 Script executed:
git ls-files | grep -i "ctoken.*payment\|payment.*ctoken" | head -20Repository: Lightprotocol/light-protocol
Length of output: 94
🏁 Script executed:
git ls-files | grep -i "docs" | grep -i "token" | head -30Repository: Lightprotocol/light-protocol
Length of output: 2231
🏁 Script executed:
cat -n ctoken_for_payments.md | head -280Repository: Lightprotocol/light-protocol
Length of output: 7933
🏁 Script executed:
rg "getAtaInterface" --type ts --type js -A 5 | head -60Repository: Lightprotocol/light-protocol
Length of output: 220
🏁 Script executed:
rg "getSignaturesForOwnerInterface|getSignaturesForAddressInterface" --type ts --type js -A 3 | head -80Repository: Lightprotocol/light-protocol
Length of output: 220
🏁 Script executed:
find . -name "unified*" -o -path "*/compressed-token/*" -name "*.ts" | grep -E "(index|types|unified)" | head -20Repository: Lightprotocol/light-protocol
Length of output: 54
🏁 Script executed:
find . -path "*/compressed-token*" -name "*.md" | head -20Repository: Lightprotocol/light-protocol
Length of output: 987
🏁 Script executed:
find . -path "*unified*" -type f | head -20Repository: Lightprotocol/light-protocol
Length of output: 54
🏁 Script executed:
rg "getAtaInterface" --max-count 20 | head -80Repository: Lightprotocol/light-protocol
Length of output: 321
🏁 Script executed:
find ./js/compressed-token -name "*.ts" -o -name "*.js" | grep -E "(index|unified)" | head -20Repository: Lightprotocol/light-protocol
Length of output: 54
🏁 Script executed:
ls -la ./js/compressed-token/Repository: Lightprotocol/light-protocol
Length of output: 304
🏁 Script executed:
find ./js/compressed-token -type f -name "*.ts" | head -30Repository: Lightprotocol/light-protocol
Length of output: 54
🏁 Script executed:
cat ./js/compressed-token/README.mdRepository: Lightprotocol/light-protocol
Length of output: 4917
🏁 Script executed:
rg "getSignaturesForOwnerInterface|getSignaturesForAddressInterface" -A 10 -B 2Repository: Lightprotocol/light-protocol
Length of output: 1771
Remove or replace console.log statements; document API signatures and behavior.
The balance and transaction history sections have documentation gaps:
-
Lines 230, 239, 258–260: Remove the three console.log statements in the transaction history example (lines 258–260) or replace all console.log calls with inline comments. Per guidelines, logging statements are not essential here—replace with comments like
// result.signatures: array of merged signaturesto show structure without the output calls. -
Line 237: Add inline comments documenting
getAtaInterface()return type and behavior:const account = await getAtaInterface(rpc, ata, owner, mint); // Returns: { parsed: { amount: bigint, ... } } // Fetches current token balance for the ATA
-
Line 256: Clarify that
getSignaturesForOwnerInterface()is a method on therpcobject (fromcreateRpc()), not an imported function. Add a comment:// rpc method: fetches merged on-chain and compressed signatures -
Line 263: Add a one-line example or explanation for
getSignaturesForAddressInterface(address)—when/why to use it instead ofgetSignaturesForOwnerInterface().
🤖 Prompt for AI Agents
In ctoken_for_payments.md around lines 222 to 264, remove the three console.log
statements and replace them with inline comments describing the returned
structures, add a brief inline comment after the getAtaInterface call explaining
its return shape and that it fetches the current ATA token balance (e.g.
parsed.amount is bigint), clarify at line ~256 that
getSignaturesForOwnerInterface is an rpc instance method (from createRpc()) by
adding a comment like “rpc method: fetches merged on-chain and compressed
signatures”, and add a one-line note at ~263 explaining when to use
getSignaturesForAddressInterface(address) vs
getSignaturesForOwnerInterface(owner) (address-specific ATA history vs
owner-wide merged history).
cli/src/utils/constants.ts
Outdated
| export const PHOTON_GIT_REPO = "https://github.com/lightprotocol/photon.git"; | ||
| export const PHOTON_GIT_COMMIT = "711c47b20330c6bb78feb0a2c15e8292fcd0a7b0"; // If empty, will use main branch. | ||
|
|
||
| //8bc3a8baeda38c62a7ac71be1d51d5c28e783842 |
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.
leftover?
| - name: Run compressed-token ctoken tests with V2 | ||
| run: | | ||
| echo "Running compressed-token ctoken tests with retry logic (max 2 attempts)..." |
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.
why do we need multiple attempts?
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.
think that was to hot fix an issue with build dependency ordering. let me try without retries
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.
it wasn't a hotfix it was so that the ci tests fail less often because test validator didn't start correctly
please preserve these retries.
wip add borsh_compat compressed_proof add new_address_owner to instructiondata trait add derive_compressed_address remaining new_address_owner impl add csdk-anchor-test program lint add address_owner trait impl add sdk libs - wip add transfer_interface, transfer_ctoken, transfer_spl_to_ctoken, transfer_ctoken_to_spl, signed, instructions rename consistently transfer_x rename file transfer_decompressed to transfer_ctoken add todos add create_ctoken_account_signed, rename create_compressible_token_account to create_compressible_token_account_instruction add create_associated_ctoken_account add inline comment to copyLocalProgramBinaries.sh remove new_address_owner add pack and unpack for tokendata first pass, compressible helpers for light-sdk wip compiles lint compressAccountsIdempotent csdk works, adjust test asserts to account is_none ctoken add signer flags for decompress_full_ctoken_accounts_with_indices wip stash: removing ctoken from compression all tests working add auto-comp, clean up tests rm dependency on patch fmt lint lint refactor rm wip clean fmt clean clean clean rm macro clean clean dedupe derivation methods clean fmt revert copyLocalProgramBinaries.sh diff add csdk_anchor_test binary to ci fix indexer fix doctest fix cli ci build target fix cli build clean address nits fix cli cache fix cache clean fix csdk anchor test program build add pkg.json csdk rebuild fix syntax fix nx rm panics fix ci fix build sdk-anchor-test try fix bmt keccak spawn_prover fix fix lint fix clock sysvar add test feature to account-compression revert profiler refactor csdk-anchor-test program lib.rs split tests fmt revert cli script reset close_for_compress_and_close to main fmt try revert build account-compression with test flag fmt fix workflow to ensure we build account-compression with test feature fix sdk test nav try sdk-tests.yml with hyphen rm idl build csdk anchor test artifact wip reuse ctoken_types move ctoken to light-compressed-token-sdk clean move pack to compressed-token-sdk clean clean clean clean clean clean wip - add macro lint clean clean fmt clean, rename to sdk-compressible-test cargo lock default auto compress false wip patch to compile wip add borsh_compat compressed_proof add new_address_owner to instructiondata trait add derive_compressed_address remaining new_address_owner impl add csdk-anchor-test program lint add address_owner trait impl add sdk libs - wip add transfer_interface, transfer_ctoken, transfer_spl_to_ctoken, transfer_ctoken_to_spl, signed, instructions rename consistently transfer_x rename file transfer_decompressed to transfer_ctoken add todos add create_ctoken_account_signed, rename create_compressible_token_account to create_compressible_token_account_instruction add create_associated_ctoken_account add inline comment to copyLocalProgramBinaries.sh remove new_address_owner add pack and unpack for tokendata first pass, compressible helpers for light-sdk wip compiles lint compressAccountsIdempotent csdk works, adjust test asserts to account is_none ctoken add signer flags for decompress_full_ctoken_accounts_with_indices wip stash: removing ctoken from compression all tests working add auto-comp, clean up tests rm dependency on patch fmt lint lint refactor rm wip clean fmt clean clean clean rm macro clean clean dedupe derivation methods clean fmt revert copyLocalProgramBinaries.sh diff add csdk_anchor_test binary to ci fix indexer fix doctest fix cli ci build target fix cli build clean address nits fix cli cache fix cache clean fix csdk anchor test program build add pkg.json csdk rebuild fix syntax fix nx rm panics fix ci fix build sdk-anchor-test try fix bmt keccak spawn_prover fix fix lint fix clock sysvar add test feature to account-compression revert profiler refactor csdk-anchor-test program lib.rs split tests fmt revert cli script reset close_for_compress_and_close to main fmt try revert build account-compression with test flag fmt fix workflow to ensure we build account-compression with test feature fix sdk test nav try sdk-tests.yml with hyphen rm idl build csdk anchor test artifact wip reuse ctoken_types move ctoken to light-compressed-token-sdk clean move pack to compressed-token-sdk clean clean clean clean clean clean wip - add macro push macros refactor compressible_instructions macro split into compressible_instructions_decompress modularized decompressaccountsidempotent add decompresscontext derive macro clean macros done compress runtime and clean fmt use small derive macros wip csdk anchor derived test using derive macros lint wip clean rm dead code clean lint fmt clean fmt dry clean lint clean rent cpi wip fmt and lint clean avoid reallocs in decompress_accounts_idempotent ixn builder remove rent sponsor and compression authority optional ctoken keys for decompress_accounts_idempotent wip auto compress pda auto compress test derive_rent_sponsor macro add disable cold state mining flag wip add complex seed test wip clean clean ignore doctest wip revert to devnenv for lightprogramtest until we can remove it clean wip address comments fixes apply suggestion in decompress_runtime.rs lint wip fix lint fix macros lint fix macro lint add standard derive_rent_sponsor helper remove unused ctoken-types dep from sdk patch rm unwrap from nested field access address final comments move decompress_runtime.rs rm derive_light_cpi_signer impl additional suggestions fix forester deps add c-token/compressible TS rename to grpc-url make grpc url opt fix tests, mint bump photon all js tests working, update ci clean up getAccountInfoInterface add v2 bound for getAccountInfoInterface wip wip add mintinstructiondata type, add serde tests. use borsh serde with overrides replace with borsh clean clean clean remove uploaders, add schema converters add unit tests for metadata json conv include unit tests in js ci cov wip fix token delegate coption parser clean fmt and lint fix v2 stateless.js ci try fix forester test with wait_for_queue_space revert stateless js skip createAccount if v2 update photon commit to parse-token + rebased to sergey/get_queue_elements_v2_rpc add load, decompress2, transferInterface, and various other helpers ts wip fmt lint, skipIf v2 for create-account js tests bump photon commit bump photon skip in rpc-multi-trees rm logs renamings fix buffer-layout and bosh upd Ata -> ATA
add console logs wip enable opt tokenMetadata additionalMetadata instruction data. createMintInterface action matching spl-token call signature refactor metadata methods, add helpers adjust test suite move back to transparent params export unified tests bump photon version fmt cleanup add fail safe to ata derivation in unified path and tests update imports and test wip refactor ctoken dirs update tests imports fix lint set to temp photon commit fix photon version again dont break old createMint bump photon again fmt fix chunking max topup sync to latest program instruction changes update compresstopubkey use photon main bump photon commit ATA -> Ata add test cov atomic tokenpool helper move to SplInterfacePda naming more unit layout and e2e interface tests add test coverage for mint-to-compressed spin out create-ata-interface.ts cleanup docstrings clean test cov: decompress2 in get-or-create-ata-interface fix decompress2 rn to decompressInterface, add test cov clean moving get-account-interface add invariants to load-ata, add test cov tests wip
1fdb923 to
3c9cbf5
Compare
adds TS client for
adds
todo
before merge, squash the commit for: https://github.com/Lightprotocol/photon/pull/44/files and update cli photon setup accordingly
Summary by CodeRabbit
Release Notes
✏️ Tip: You can customize this high-level summary in your review settings.