docs: add ephemeral SPL token lifecycle guide#9
Conversation
WalkthroughThe PR adds a new reference document for Ephemeral SPL token handling, covering SDK-driven and direct-program workflows, Anchor CPI usage, and operational caveats. It also updates one lamports-topup reference link to a new example app path. ChangesEphemeral SPL token lifecycle guide
Lamports-topup reference update
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
…e-example-paths docs: update engine example paths
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
skill/ephemeral-spl-token.md (1)
44-49: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winSeparate the Model A and Model B state descriptions.
This paragraph says both models use the eATA/global-vault model, but Model A is defined earlier as the canonical ATA-on-ER flow with no eATA/vault PDA. As written, readers will derive the wrong accounts for the SDK path.
Proposed fix
-Both models share the same base-layer state: deposited tokens are locked in the global vault, the user's balance is recorded in the eATA, and the eATA is delegated to the delegation program. -The difference is purely which surface you touch: canonical ATAs + SDK helpers (A) versus raw PDAs + program instructions (B). +Model A: the delegated balance appears at the owner's canonical ATA on the ER, and clients use the SDK helpers. +Model B: deposits are tracked with the eATA/global-vault PDAs and the raw program instruction surface.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@skill/ephemeral-spl-token.md` around lines 44 - 49, Separate the state descriptions for Model A and Model B in the ephemeral-spl-token document: the current paragraph in the section describing the two models incorrectly gives both flows the eATA/global-vault model. Update the text around the Model A and Model B descriptions so Model A clearly refers to the canonical ATA-on-ER SDK helper flow, while Model B is the one that uses raw PDAs, eATA, and the global vault; keep the account/state terminology consistent with the earlier definitions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@skill/ephemeral-spl-token.md`:
- Around line 44-49: Separate the state descriptions for Model A and Model B in
the ephemeral-spl-token document: the current paragraph in the section
describing the two models incorrectly gives both flows the eATA/global-vault
model. Update the text around the Model A and Model B descriptions so Model A
clearly refers to the canonical ATA-on-ER SDK helper flow, while Model B is the
one that uses raw PDAs, eATA, and the global vault; keep the account/state
terminology consistent with the earlier definitions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: ccac746e-4fdc-44c4-8384-78f87516244a
📒 Files selected for processing (2)
skill/ephemeral-spl-token.mdskill/lamports-topup.md
What
Adds an end-to-end Ephemeral SPL Token lifecycle reference and aligns top-level skill routing with it.
skill/ephemeral-spl-token.mddocuments two integration models:delegateSpl/transferSpl/undelegateIx/withdrawSpl, canonical-ATA balances on the ER, endpoint routing, and the Anchor app-program pattern using plain SPL CPI over delegated ATAs.ephemeral-spl-apiexports, core instruction account metas, and low-level TypeScript builders.getIdentity/ routergetDelegationStatus.initVaultIfMissing, one undelegate per transaction, waiting for commits before withdrawal,idempotentmode consistency, endpoint/blockhash pairing, and rent PDA funding.dist/artifacts.Why
The skill needed a practical lifecycle guide for agents integrating SPL tokens on Ephemeral Rollups, with the SDK flow as the default path and direct
ephemeral-spl-apiusage documented as the lower-level path.Testing
bash build.shpython3 <skill-quality-gate>/scripts/skill_gate.py skill --run-testspython3 <skill-self-heal>/scripts/audit_self_heal.py skillmagicblock-engine-examples/spl-tokensexample.Breaking changes
None. Documentation only.
Summary by CodeRabbit