Skip to content

fix: pin @raydium-io/raydium-sdk to exact 1.3.1-beta.50#27

Open
mannutech wants to merge 1 commit into
chainstacklabs:mainfrom
mannutech:fix/pin-raydium-sdk-and-add-ci
Open

fix: pin @raydium-io/raydium-sdk to exact 1.3.1-beta.50#27
mannutech wants to merge 1 commit into
chainstacklabs:mainfrom
mannutech:fix/pin-raydium-sdk-and-add-ci

Conversation

@mannutech

@mannutech mannutech commented Jun 15, 2026

Copy link
Copy Markdown

Context

Refs #15.

The example depends on the legacy v1 SDK (@raydium-io/raydium-sdk), published only as 1.3.1-beta.* pre-releases whose TypeScript types have drifted over the API's life — e.g. the Token constructor gaining a programId argument, and makeTxVersion being added to the swap-instruction params. Those are the changes behind the compile errors reported in #15 (makeTxVersion not existing on the params type; PublicKey vs number argument mismatches): they trace to the pre-beta.50 SDK 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 --noEmit passes against every version the ^1.3.1-beta.50 caret can resolve to — beta.50 through beta.58 (the complete eligible set: the caret floors out the broken pre-.50 betas, and 1.3.0 / 2.0.0-beta.0 are 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.lock key so every install is deterministic:

- "@raydium-io/raydium-sdk": "^1.3.1-beta.50"
+ "@raydium-io/raydium-sdk": "1.3.1-beta.50"

Resolved version is unchanged (beta.50) — no behavior change, no source edit. Two-line diff (package.json + yarn.lock).

Verification

$ npx tsc --noEmit
$ echo $?
0

$ npm ls @raydium-io/raydium-sdk
raydium-swap-example@1.0.0
`-- @raydium-io/raydium-sdk@1.3.1-beta.50

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:

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The @raydium-io/raydium-sdk dependency in package.json is changed from a caret range (^1.3.1-beta.50) to an exact pinned version (1.3.1-beta.50), preventing automatic upgrades to newer compatible releases.

Changes

Dependency Pinning

Layer / File(s) Summary
Pin @raydium-io/raydium-sdk to exact version
package.json
Removes the caret prefix from ^1.3.1-beta.50, locking the dependency to exactly 1.3.1-beta.50.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A caret once roamed, free to upgrade with glee,
But the rabbit said "No! Pin it, just let it be!"
1.3.1-beta.50 — no more, no less,
A locked little package, tidy and blessed. 🐇
Exactness is peace, and the warren agrees!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: pinning the @raydium-io/raydium-sdk dependency to exact version 1.3.1-beta.50, which directly addresses the non-deterministic dependency resolution issue described in the PR objectives.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between d9587ca and ad455aa.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (3)
  • .github/workflows/ci.yml
  • README.md
  • package.json

Comment thread .github/workflows/ci.yml Outdated
Comment thread README.md Outdated
@mannutech mannutech force-pushed the fix/pin-raydium-sdk-and-add-ci branch from ad455aa to 0a44bff Compare June 15, 2026 22:23
@mannutech mannutech changed the title build: pin raydium-sdk to an exact beta and add typecheck CI fix: pin @raydium-io/raydium-sdk to exact 1.3.1-beta.50 (#15) Jun 15, 2026
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>
@mannutech mannutech force-pushed the fix/pin-raydium-sdk-and-add-ci branch from 0a44bff to 5f6c375 Compare June 15, 2026 22:44
@mannutech mannutech changed the title fix: pin @raydium-io/raydium-sdk to exact 1.3.1-beta.50 (#15) fix: pin @raydium-io/raydium-sdk to exact 1.3.1-beta.50 Jun 15, 2026
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