Skip to content

Four majors of @stellar/stellar-sdk in one repo, two behind latest — unify and make it a peer dep #660

Description

@Miracle656

The problem

One monorepo, four different majors of @stellar/stellar-sdk, none of them current:

Package Declares
sdk ^15.1.0
frontend/wallet ^14.6.1
frontend/mobile ^14.6.1
packages/agent ^16.1.0
latest on npm 17.0.1

And it really does duplicate at install time:

frontend/mobile/node_modules/@stellar/stellar-sdk                     14.6.1
frontend/mobile/node_modules/@blend-capital/blend-sdk/node_modules/…  16.0.0
frontend/wallet/node_modules/@stellar/stellar-sdk                     14.6.1
frontend/wallet/node_modules/@blend-capital/blend-sdk/node_modules/…  14.4.3
packages/agent/node_modules/@stellar/stellar-sdk                      14.6.1

Note the last row: the agent declares ^16.1.0 but has 14.6.1 installed.

Why it is worth fixing

Two copies of stellar-sdk in one process means two separate class identities. An Asset, Transaction or Keypair built by one copy fails instanceof against the other, and the failure surfaces far from its cause as a confusing type or serialisation error rather than a clean version conflict. We already spend real time debugging in this area.

The SDK also declares @stellar/stellar-sdk as a regular dependency, which guarantees a consumer gets our copy alongside their own. For a library this belongs in peerDependencies, so the application chooses the version and there is exactly one.

Scope

  • Move @stellar/stellar-sdk to peerDependencies (plus devDependencies for building and tests) in sdk/package.json
  • Align every package in the repo onto one major, ideally current
  • Fix the agent's declared-vs-installed drift
  • Note in the PR whether @blend-capital/blend-sdk can be satisfied by the shared copy or genuinely needs its own

Watch out for

  • 14 → 17 crosses two majors. Read the stellar-sdk changelogs; expect breaking changes around rpc/SorobanRpc naming, Horizon types and transaction assembly. This is not a version-bump-and-ship.
  • Protocol 25 (X-Ray) is live on mainnet. Confirm the chosen version supports what the contracts use before settling on it.
  • The passkey signing path is the sharpest edge — derToRawSignature, low-S normalisation, SorobanAuthorizationEntry assembly. Re-verify a real passkey spend on testnet after upgrading; a green typecheck proves nothing here.
  • Contracts must not be redeployed. The mainnet WASM matches contracts/expected-hashes.json byte-for-byte and that reproducible-build claim is load-bearing. This is a JS-side change only.
  • Mobile uses plain npm install, not --legacy-peer-deps. sdk/ is the opposite.

Acceptance criteria

  • @stellar/stellar-sdk is a peer dependency of the SDK
  • One major across sdk, frontend/wallet, frontend/mobile, packages/agent, and declared matches installed
  • No duplicate copy in the install tree except any that blend-sdk provably requires
  • A passkey-authorised transaction verified end to end on testnet, with the hash in the PR
  • Typecheck, tests and builds green in every touched package

Drips Wave · Complexity: Advanced · 200 points


Required: Before submitting, join the contributor Telegram so your work can be tracked and counted toward the Stellar Wave: https://t.me/+fxHXq8f1SwlkZDBk

Activity

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

Metadata

Metadata

Assignees

Labels

Stellar WaveDrips Wave program issuearea:sdkTypeScript SDKdependenciesPull requests that update a dependency filedifficulty:advancedMulti-day projecthelp wantedExtra attention is neededpoints:200Advanced tier — 200 Wave points

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions