fix: pin @raydium-io/raydium-sdk to exact 1.3.1-beta.50#27
Conversation
📝 WalkthroughWalkthroughThe ChangesDependency Pinning
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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.
Inline comments:
In @.github/workflows/ci.yml:
- Around line 9-10: Replace the floating version tags (`@v4`) with pinned commit
SHAs for both the actions/checkout and actions/setup-node actions to ensure
immutability. Additionally, add the parameter persist-credentials: false to the
actions/checkout action to prevent credential persistence and improve security
hardening of the CI pipeline.
In `@README.md`:
- Around line 151-153: The documented command `ts-node src/trimMainnet.ts` does
not account for the fact that the trimMainnet.ts script uses relative paths like
`../mainnet.json` that are resolved from the current working directory. Running
this command from the repo root will cause the relative paths to resolve
incorrectly. Update the README documentation to either specify that the command
should be run from the `src/` directory (for example, `cd src && ts-node
trimMainnet.ts`) or add explicit clarification about the required working
directory to ensure users run the command from the correct location.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 2f38c826-e150-4d4f-b76f-1076edfacb4d
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (3)
.github/workflows/ci.ymlREADME.mdpackage.json
ad455aa to
0a44bff
Compare
The legacy v1 SDK is published only as 1.3.1-beta.* pre-releases whose types have drifted across the API's life (e.g. the Token constructor gaining a programId arg, and makeTxVersion being added to the swap params) — the changes behind the compile errors in chainstacklabs#15. The example currently builds clean against every version the `^1.3.1-beta.50` caret can resolve to (beta.50 through beta.58), so this is not a fix for a reproducible failure today — it's a preventive pin. A caret over an unstable pre-release line is fragile: it can drift to a future beta whose types differ, and it resolves ambiguously across package managers. Pinning to an exact, known-good 1.3.1-beta.50 (and aligning the yarn.lock key) makes every install deterministic. Resolved version is unchanged; no source changes required. Refs chainstacklabs#15 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
0a44bff to
5f6c375
Compare
Context
Refs #15.
The example depends on the legacy v1 SDK (
@raydium-io/raydium-sdk), published only as1.3.1-beta.*pre-releases whose TypeScript types have drifted over the API's life — e.g. theTokenconstructor gaining aprogramIdargument, andmakeTxVersionbeing added to the swap-instruction params. Those are the changes behind the compile errors reported in #15 (makeTxVersionnot existing on the params type;PublicKeyvsnumberargument mismatches): they trace to the pre-beta.50SDK API, not to this repo's source (which has been unchanged on those lines since the initial commit).What this PR is — and isn't
I reproduced first, and want to be straight about the result: the example currently builds clean.
tsc --noEmitpasses against every version the^1.3.1-beta.50caret can resolve to —beta.50throughbeta.58(the complete eligible set: the caret floors out the broken pre-.50betas, and1.3.0/2.0.0-beta.0are out of range). So this is not a fix for a reproducible failure today.It's a preventive pin. A caret over an unstable pre-release line is fragile:
Fix
Pin to an exact, known-good version and align the
yarn.lockkey so every install is deterministic:Resolved version is unchanged (
beta.50) — no behavior change, no source edit. Two-line diff (package.json+yarn.lock).Verification
npm run swap(simulation mode,executeSwap: false) also runs end-to-end without a type or runtime crash.Follow-ups (intentionally out of scope)
Kept this PR minimal. Natural next steps, happy to open separately:
typecheckscript + CI to catch future dependency drift automatically;@raydium-io/raydium-sdk-v2.🤖 Generated with Claude Code