update @stellar/stellar-sdk to v17 - #2176
Conversation
|
Preview is available here: |
There was a problem hiding this comment.
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
Uint8Arrayvalues. - 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.
|
Preview is available here: |
There was a problem hiding this comment.
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-parserat 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
contractExecutableExternalRefarm (CAP-85), but this branch still accepts only WASM and SAC executables. Loading an external-reference contract therefore reachesUnknown contract typeand the contract explorer fails, even though v17 providesgetExternalRefWasmHashto 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.tsstill haswebServer.command: "pnpm dev"and noexpect.timeoutoverride. 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.
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>
|
Preview is available here: |
|
Preview is available here: |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Preview is available here: |

@stellar/stellar-sdkto17.0.0-rc.2and migrated the XDR API surface —toXDR/fromXDRwere renamed, byte-returning methods now yieldUint8Array, and XDR accessors moved from methods to propertiesreplaceAuthEntrieswith tests — v17 requires replacing entries in place on areadonly-typed array, where assigning a copy type-checks while silently dropping every signed authorizationTransactionDetailsthrowing on legacyv0and muxed-source envelopes by narrowing all three envelope variants exhaustively — muxed (M…) sources now render-rather than crashing the pageUint256Byteswith.toBytes()beforeStrKey.encodeEd25519PublicKey— v17 made the named byte aliases wrapper classes rather thanUint8Array, so the explorer detail page threwRangeErroron every transaction until rc.2's tightened declarations caught itSignaturesintoresolveSignatureRowsso hint and signature hex decoding is unit-testableStellarXdr.types()instead offunctions(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)submitStepContenttests, which had depended onNetworkSelector's default-network effect landing before the first assertion, unlike the sibling test files@exodus/bytesto the Jest ESM transform allowlist, a new transitive dependency of the SDKTODO: handle CAP-71 v2 auth flagat five call sites rather than resolving it here — rc.2 defaultsuseUpgradedAuth/authV2totrue, soprepareTransactionnow requestsADDRESS_V2whileuseSimulateTx's hand-rolled JSON-RPC call still doesn't send the flagImportant
The CAP-71 v2 auth flag is deliberately left unresolved in this PR, but the behaviour has already changed:
simulateTransactionnow always sendsuseUpgradedAuthon the wire (it previously omitted the field when unset), which older or custom RPC endpoints may reject. The fiveTODO: handle CAP-71 v2 auth flagmarkers track where the decision needs to be made. When it lands,txDashSignatures.test.tsreadscredentials.addressdirectly and will need theaddressV2arm. We need to decide whether to enforce v2 flag always or allow users to select depending on their RPC settings.