Skip to content

update @stellar/stellar-sdk to v17 - #2176

Merged
quietbits merged 9 commits into
mainfrom
stellar-sdk-v17
Aug 25, 2026
Merged

update @stellar/stellar-sdk to v17#2176
quietbits merged 9 commits into
mainfrom
stellar-sdk-v17

Conversation

@quietbits

@quietbits quietbits commented Aug 12, 2026

Copy link
Copy Markdown
Contributor
  • Updated @stellar/stellar-sdk to 17.0.0-rc.2 and migrated the XDR API surface — toXDR/fromXDR were renamed, byte-returning methods now yield Uint8Array, and XDR accessors moved from methods to properties
  • Extracted the simulate step's auth-entry replacement into replaceAuthEntries with tests — v17 requires replacing entries in place on a readonly-typed array, where assigning a copy type-checks while silently dropping every signed authorization
  • Fixed TransactionDetails throwing on legacy v0 and muxed-source envelopes by narrowing all three envelope variants exhaustively — muxed (M…) sources now render - rather than crashing the page
  • Unwrapped Uint256Bytes with .toBytes() before StrKey.encodeEd25519PublicKey — v17 made the named byte aliases wrapper classes rather than Uint8Array, so the explorer detail page threw RangeError on every transaction until rc.2's tightened declarations caught it
  • Extracted signature-row resolution out of Signatures into resolveSignatureRows so hint and signature hex decoding is unit-testable
  • Sourced the XDR type dropdown from StellarXdr.types() instead of functions(xdr) — the list came from the JS SDK while decoding runs through @stellar/stellar-xdr-json, and v17 drove them apart to 1058 entries with 608 the decoder rejects (was 437/4 on v16)
  • Seeded the network in submitStepContent tests, which had depended on NetworkSelector's default-network effect landing before the first assertion, unlike the sibling test files
  • Added @exodus/bytes to the Jest ESM transform allowlist, a new transitive dependency of the SDK
  • Marked the CAP-71 v2 auth decision with TODO: handle CAP-71 v2 auth flag at five call sites rather than resolving it here — rc.2 defaults useUpgradedAuth/authV2 to true, so prepareTransaction now requests ADDRESS_V2 while useSimulateTx's hand-rolled JSON-RPC call still doesn't send the flag

Important

The CAP-71 v2 auth flag is deliberately left unresolved in this PR, but the behaviour has already changed: simulateTransaction now always sends useUpgradedAuth on the wire (it previously omitted the field when unset), which older or custom RPC endpoints may reject. The five TODO: handle CAP-71 v2 auth flag markers track where the decision needs to be made. When it lands, txDashSignatures.test.ts reads credentials.address directly and will need the addressV2 arm. We need to decide whether to enforce v2 flag always or allow users to select depending on their RPC settings.

Copilot AI balanced review requested due to automatic review settings August 12, 2026 21:51
@github-project-automation github-project-automation Bot moved this to Backlog (Not Ready) in DevX Aug 12, 2026
@quietbits
quietbits marked this pull request as draft August 12, 2026 21:52
@stellar-jenkins-ci

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Migrates Stellar Laboratory to Stellar SDK v17 RC, adapting XDR APIs, byte handling, transaction rendering, and test infrastructure.

Changes:

  • Migrates renamed XDR methods, property accessors, and Uint8Array values.
  • Fixes Soroban auth replacement, signature decoding, and envelope handling.
  • Expands regression tests and adjusts Playwright CI execution.

Reviewed changes

Copilot reviewed 64 out of 67 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/unit/txHelper.test.ts Tests signature extraction and duplicate signer handling.
tests/unit/sorobanAuthUtils.test.ts Tests auth detection and replacement.
tests/unit/signTransactionPage.test.ts Tests fee-bump hash formatting.
tests/unit/resolveSignatureRows.test.ts Tests signature-row resolution.
tests/unit/messageHelper.test.ts Adapts message-signing assertions.
tests/unit/getScValsFromArgs.test.ts Migrates XDR integer construction.
tests/unit/getRequiredSigners.test.ts Tests v17 hashes and signature completeness.
tests/unit/callStackTrace/hasEllipsisAnywhere.test.ts Reformats test fixtures.
tests/e2e/submitStepContent.test.ts Seeds network state deterministically.
tests/e2e/buildTransaction.test.ts Migrates transaction decoding and memo bytes.
src/validate/methods/getXdrError.ts Migrates XDR validation methods.
src/types/styles.d.ts Declares stylesheet modules.
src/query/useWasmBinaryFromRpc.ts Returns WASM as Uint8Array.
src/query/useSubmitRpcTx.ts Migrates RPC submission XDR APIs.
src/query/useSubmitHorizonTx.ts Migrates Horizon transaction decoding.
src/query/useRpcPrepareTx.ts Migrates transaction preparation APIs.
src/query/useRpcAssembleTx.ts Migrates transaction assembly APIs.
src/query/useLatestTxn.ts Migrates envelope serialization.
src/query/useGetContractDataFromRpcById.ts Migrates contract-data union access.
src/query/useBuildRpcTransaction.ts Migrates prepared-envelope serialization.
src/query/useAddTrustline.ts Migrates trustline XDR serialization.
src/hooks/useImportSignatureCompleteness.ts Migrates imported transaction parsing.
src/helpers/xdr/utils.ts Migrates price field accessors.
src/helpers/txHelper.ts Migrates signing and signature-byte handling.
src/helpers/transactionHashFromXdr.ts Converts v17 hashes to hex.
src/helpers/sorobanUtils.ts Migrates Soroban XDR accessors.
src/helpers/sorobanAuthUtils.ts Adds in-place auth-entry replacement.
src/helpers/readObj.ts Migrates contract input name access.
src/helpers/parseImportXdr.ts Migrates imported XDR parsing.
src/helpers/messageHelper.ts Adopts Uint8Array signature values.
src/helpers/getWasmContractData.ts Accepts Uint8Array WASM.
src/helpers/getClaimableBalanceIdFromXdr.ts Migrates transaction parsing.
src/helpers/getBuildVerification.ts Migrates contract executable inspection.
src/helpers/fetchTxSignatures.ts Migrates signature and hash bytes.
src/helpers/explorer/normalizeTransaction.ts Migrates explorer envelope serialization.
src/helpers/downloadFile.ts Supports Uint8Array downloads.
src/helpers/decodeScVal.ts Migrates ScVal decoding.
src/helpers/checkRequiredSignatures.ts Migrates hash and decorated-signature handling.
src/constants/signTransactionPage.ts Fixes fee-bump hash formatting.
src/components/TransactionSuccessCard.tsx Migrates result XDR serialization.
src/components/SorobanAuthSigning/index.tsx Migrates auth-entry XDR APIs.
src/components/SorobanAuthSigning/AuthEntryItem.tsx Migrates individual auth signing.
src/components/SignTransactionXdr/index.tsx Migrates transaction signing XDR APIs.
src/components/PrettyJsonTransaction.tsx Compares Uint8Array signatures.
src/components/FormElements/FetchContractMethodPickerWithQuery.tsx Migrates function-name accessors.
src/app/(sidebar)/xdr/view/page.tsx Migrates XDR viewer parsing.
src/app/(sidebar)/transactions-explorer/tx/[tx]/components/TransactionDetails.tsx Handles all envelope variants safely.
src/app/(sidebar)/transaction/import/components/SimulateStepContent.tsx Migrates imported invocation detection.
src/app/(sidebar)/transaction/import/components/ImportStepContent.tsx Migrates parsing and hash formatting.
src/app/(sidebar)/transaction/fee-bump/OperationNamesFromXdr.tsx Migrates operation parsing.
src/app/(sidebar)/transaction/fee-bump/FeeBumpStepContent.tsx Migrates fee-bump hash formatting.
src/app/(sidebar)/transaction/dashboard/components/Signatures.tsx Migrates inner hash formatting.
src/app/(sidebar)/transaction/components/SubmitStepContent.tsx Migrates submitted-result serialization.
src/app/(sidebar)/transaction/components/SimulationResourceTable.tsx Migrates simulation resource accessors.
src/app/(sidebar)/transaction/components/SimulateStepContent.tsx Uses reliable signed-auth replacement.
src/app/(sidebar)/transaction/components/Signatures.tsx Extracts signature-row resolution.
src/app/(sidebar)/transaction/components/resolveSignatureRows.ts Adds testable signature resolution.
src/app/(sidebar)/transaction/build/components/SorobanTransactionXdr.tsx Migrates Soroban hash formatting.
src/app/(sidebar)/transaction/build/components/ClassicTransactionXdr.tsx Migrates classic hash formatting.
src/app/(sidebar)/smart-contracts/deploy-contract/page.tsx Migrates WASM and return-value bytes.
src/app/(sidebar)/smart-contracts/contract-explorer/components/InvokeContract.tsx Migrates contract function accessors.
src/app/(sidebar)/smart-contracts/contract-explorer/components/ContractStorage.tsx Migrates ledger-key serialization.
pnpm-lock.yaml Locks SDK v17 RC dependencies.
playwright.config.ts Uses production builds in CI and longer assertions.
package.json Upgrades Stellar SDK to v17 RC.
jest.config.js Transforms the SDK’s new ESM dependency.
CLAUDE.md Removes the outdated SDK version reference.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread playwright.config.ts Outdated
@stellar-jenkins-ci

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 64 out of 67 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file
Suppressed comments (3)

package.json:36

  • The SDK upgrade leaves @stellar-expert/contract-wasm-interface-parser at 4.1.0; the lockfile resolves that release against the legacy standalone @stellar/stellar-base@15.0.0. The parser's current 5.x line was specifically migrated to the new SDK package/API, so keeping 4.1.0 can make contract metadata/spec decoding use mismatched XDR definitions. Upgrade the parser alongside the SDK and regenerate the lockfile.
    "@stellar/stellar-sdk": "17.0.0-rc.1",

src/query/useGetContractDataFromRpcById.ts:67

  • SDK v17 adds the contractExecutableExternalRef arm (CAP-85), but this branch still accepts only WASM and SAC executables. Loading an external-reference contract therefore reaches Unknown contract type and the contract explorer fails, even though v17 provides getExternalRefWasmHash to resolve its WASM. Include this variant and resolve its hash before returning the contract data.
    tests/e2e/submitStepContent.test.ts:110
  • The PR description says CI was switched to a production build and the Playwright assertion timeout was raised, but playwright.config.ts still has webServer.command: "pnpm dev" and no expect.timeout override. This network seed does not address the documented lazy-route compilation timeout, so the advertised e2e stabilization is incomplete. Add the described config changes or correct the PR description.

quietbits and others added 2 commits August 18, 2026 09:30
Unwrap Uint256Bytes with toBytes() before StrKey.encodeEd25519PublicKey in
the tx explorer — rc.2 tightened the declarations on the named byte-alias
wrappers, surfacing what was already a runtime throw.

Flag the CAP-71 v2 auth-flag decision points with TODOs: rc.2 flipped
useUpgradedAuth/authV2 to default true, so prepareTransaction now requests
ADDRESS_V2 credentials.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The dropdown listed `functions(xdr)` from the JS SDK while decoding runs
through @stellar/stellar-xdr-json. v16 kept the two roughly aligned (437
entries, 4 the decoder rejects), but v17's class-based rebuild added a class
per union arm plus base classes and helpers, taking it to 1058 entries with
608 rejected — while still missing 21 types the decoder accepts.

Read the list from StellarXdr.types() instead, so it tracks whatever version
of the decoder is installed. Dropdown is now exactly the 471 accepted types.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@stellar-jenkins-ci

Copy link
Copy Markdown

@quietbits
quietbits marked this pull request as ready for review August 18, 2026 17:26
Comment thread src/helpers/fetchTxSignatures.ts Outdated
@jeesunikim

jeesunikim commented Aug 19, 2026

Copy link
Copy Markdown
Contributor
Screenshot 2026-08-19 at 3 47 36 PM

Contract Spec isn't showing up when I checked out this branch locally and via preview link. The contract ids I used

  • CDL74RF5BLYR2YBLCCI7F5FB6TPSCLKEJUBSD2RSVWZ4YHF3VMFAIGWA (Kale)
  • CDVQVKOY2YSXS2IC7KN6MNASSHPAO7UN2UR2ON4OI2SKMFJNVAMDX6DP (Blend)

It's related to @stellar-expert/contract-wasm-interface-parser/ expecting Buffer. Two call sites are affected:

  • ContractSpecMeta.tsx:94 (RPC -> Uint8Array)
  • deploy-contract/page.tsx:127 via rpcWasmBinary (line 317) (RPC -> Uint8Array)

Comment thread src/helpers/getBuildVerification.ts
Comment thread tests/e2e/submitStepContent.test.ts
@stellar-jenkins-ci

Copy link
Copy Markdown

@quietbits
quietbits requested a review from jeesunikim August 24, 2026 18:02
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​stellar/​stellar-sdk@​17.0.09910010099100

View full report

@stellar-jenkins-ci

Copy link
Copy Markdown

@quietbits
quietbits merged commit ebd17e7 into main Aug 25, 2026
7 checks passed
@quietbits
quietbits deleted the stellar-sdk-v17 branch August 25, 2026 13:07
@github-project-automation github-project-automation Bot moved this from Backlog (Not Ready) to Done in DevX Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants