fix: update ContractDataDurability enum access for SDK v17 - #2855
Merged
ElliotFriend merged 1 commit intoSep 14, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates JavaScript SDK examples for the typed XDR enum API introduced in SDK v17.
Changes:
- Replaces four obsolete enum factory calls with static enum values.
- Updates the related temporary-durability comment.
Recommendation: MERGE-READY — correct, complete, and scoped appropriately.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
docs/data/apis/rpc/api-reference/methods/getLedgerEntries.mdx |
Updates persistent and temporary durability syntax. |
docs/build/guides/archival/extend-persistent-entry-js.mdx |
Fixes two persistent-entry examples. |
docs/build/guides/archival/create-restoration-footprint-js.mdx |
Fixes restoration-footprint enum access. |
Note
Copilot is running an experiment and ran this review at Balanced.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
SDK v17 replaced the js-xdr library with typed XDR. Enums are now static singleton objects, not factory functions. Calling `xdr.ContractDataDurability.persistent()` throws TypeError on v17+. The v17.0.0 changelog documents this: "Enums are singletons, not factory calls."
yigitcangokmen
force-pushed
the
fix/contractdatadurability-v17-syntax
branch
from
September 13, 2026 16:41
31f9c07 to
814f900
Compare
ElliotFriend
approved these changes
Sep 14, 2026
Contributor
|
PR Preview: torn down |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SDK v17 replaced the js-xdr library with typed XDR.
ContractDataDurability.persistentis now a static enum object, not a factory function. Calling it with()throwsTypeError: xdr.ContractDataDurability.persistent is not a function.The v17.0.0 changelog documents this: "Enums are singletons, not factory calls."
This removes the trailing
()on 4 executable lines and 1 comment across 3 files:extend-persistent-entry-js.mdxlines 54, 233getLedgerEntries.mdxlines 222 (comment), 223create-restoration-footprint-js.mdxline 58guestbook/frontend.mdx:426has the same pattern but is already covered by #2837.Verified on
@stellar/stellar-sdk@17.0.1: