Skip to content

fix: add delegate to packed accounts in decompress, chunk proofs#2284

Open
SwenSchaeferjohann wants to merge 21 commits intomainfrom
swen/pub-beta-cov
Open

fix: add delegate to packed accounts in decompress, chunk proofs#2284
SwenSchaeferjohann wants to merge 21 commits intomainfrom
swen/pub-beta-cov

Conversation

@SwenSchaeferjohann
Copy link
Contributor

@SwenSchaeferjohann SwenSchaeferjohann commented Feb 13, 2026

Summary by CodeRabbit

  • Documentation

    • Removed the comprehensive c-token payments guide, including setup, payment/receive flows, instruction-level examples, batching/transaction assembly guidance, unwrap/balance/history info, and the quick API reference for c-token and SPL token usage.
  • Chores

    • Cleaned up obsolete documentation artifacts related to c-token payment integration.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 13, 2026

📝 Walkthrough

Walkthrough

The documentation file ctoken_for_payments.md was removed entirely; its guide and examples for c-token payment flows, APIs, and usage guidance were deleted.

Changes

Cohort / File(s) Summary
Documentation removed
ctoken_for_payments.md
Complete deletion of the c-token payments guide and all examples (setup, receive/pay flows, instruction-level patterns, batching/transaction assembly, idempotent ATA creation, unwrap, balance/history, and quick reference). No code or public API declarations changed in this diff.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A page of flows and examples took flight,
Its lines folded into quiet night.
The repo breathes in empty space,
Ready for a clearer, newer place. ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title describes adding delegate to packed accounts in decompress and chunk proofs, but the actual change is removing the ctokens_for_payments.md documentation file entirely. Update the title to accurately reflect the primary change, such as 'docs: remove ctokens_for_payments.md documentation' or clarify what the actual code changes are.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch swen/pub-beta-cov

No actionable comments were generated in the recent review. 🎉


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@SwenSchaeferjohann SwenSchaeferjohann changed the title fix(js): add delegate to packed accounts in decompress, chunk proofs fix: add delegate to packed accounts in decompress, chunk proofs Feb 13, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
ctoken_for_payments.md (1)

268-311: ⚠️ Potential issue | 🟡 Minor

Fix the misleading "parallel" comment and surface the new decimals requirement.

The example has three issues worth addressing:

  1. Misleading parallel execution: The comment says "in parallel, if any" but the code uses sequential for-loop with await on each iteration. Either execute truly in parallel using Promise.all() or correct the comment to reflect sequential execution.

  2. New decimals parameter is required: The createUnwrapInstruction now requires the mint's decimals (for transfer_checked validation). The example correctly fetches this via getMint, but this change should be called out since it differs from previous API versions.

  3. Missing error handling: In production, both the load batches loop and the unwrap transaction should be wrapped in try-catch blocks with appropriate failure handling (retries, user notifications, etc.).

Example: Fix parallel execution or comment

For truly parallel execution:

-// Send load batches first (in parallel, if any), then unwrap tx
-for (const batch of loadBatches) {
-  await sendAndConfirmTransaction(rpc, new Transaction().add(...batch), [
-    payer,
-    owner,
-  ]);
-}
+// Send load batches in parallel (if any), then unwrap tx
+if (loadBatches.length > 0) {
+  await Promise.all(
+    loadBatches.map(batch =>
+      sendAndConfirmTransaction(rpc, new Transaction().add(...batch), [payer, owner])
+    )
+  );
+}

Or, for sequential (fix comment):

-// Send load batches first (in parallel, if any), then unwrap tx
+// Send load batches first (if any), then unwrap tx
 for (const batch of loadBatches) {
🤖 Fix all issues with AI agents
In `@ctoken_for_payments.md`:
- Around line 144-159: Add a cross-reference to the official
js/compressed-token/docs/payment-integration.md and a brief note next to the
createTransferInterfaceInstructions example: mention the hot/cold sender pattern
and the rule "For a hot sender or <=8 cold inputs, the result is a
single-element array", and instruct readers to run loadBatches (the rest
returned by sliceLast) in parallel and then submit transferBatch sequentially;
reference the symbols createTransferInterfaceInstructions, sliceLast,
loadBatches, and transferBatch and add a link to the payment-integration.md
which contains the full usage example and the table describing contents of each
transaction.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

🤖 Fix all issues with AI agents
In `@ctoken_for_payments.md`:
- Around line 312-318: The comment says "Send load batches first (in
parallel...)" but the for-loop over loadBatches runs sequentially; update to
actually send in parallel by mapping loadBatches to an array of
sendAndConfirmTransaction promises using sendAndConfirmTransaction(rpc, new
Transaction().add(...batch), [payer, owner]) and await Promise.all(...) (or,
alternatively, change the comment to remove "in parallel" if sequential behavior
is intended). Ensure you reference loadBatches, sendAndConfirmTransaction, rpc,
Transaction, payer, and owner when making the change so the behavior and intent
remain clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant