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
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
The problem
One monorepo, four different majors of
@stellar/stellar-sdk, none of them current:sdk^15.1.0frontend/wallet^14.6.1frontend/mobile^14.6.1packages/agent^16.1.0And it really does duplicate at install time:
Note the last row: the agent declares
^16.1.0but 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,TransactionorKeypairbuilt by one copy failsinstanceofagainst 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-sdkas a regular dependency, which guarantees a consumer gets our copy alongside their own. For a library this belongs inpeerDependencies, so the application chooses the version and there is exactly one.Scope
@stellar/stellar-sdktopeerDependencies(plusdevDependenciesfor building and tests) insdk/package.json@blend-capital/blend-sdkcan be satisfied by the shared copy or genuinely needs its ownWatch out for
rpc/SorobanRpcnaming,Horizontypes and transaction assembly. This is not a version-bump-and-ship.derToRawSignature, low-S normalisation,SorobanAuthorizationEntryassembly. Re-verify a real passkey spend on testnet after upgrading; a green typecheck proves nothing here.contracts/expected-hashes.jsonbyte-for-byte and that reproducible-build claim is load-bearing. This is a JS-side change only.npm install, not--legacy-peer-deps.sdk/is the opposite.Acceptance criteria
@stellar/stellar-sdkis a peer dependency of the SDKsdk,frontend/wallet,frontend/mobile,packages/agent, and declared matches installedRequired: Before submitting, join the contributor Telegram so your work can be tracked and counted toward the Stellar Wave: https://t.me/+fxHXq8f1SwlkZDBk