SPIKE: Protocol 28 (CAP-0084)#1507
Draft
sisuresh wants to merge 4 commits into
Draft
Conversation
js-stellar-sdk v16 vendors the former stellar-base into src/base and owns XDR generation (xdr/*.x -> src/base/generated via Makefile/xdrgen). Ports the CAP-0084 changes from stellar/js-stellar-base#980 (head d79a2b7): - xdr/{curr,next}/Stellar-contract.x: SC_ADDRESS_TYPE_MUXED_CONTRACT arm, MuxedContract struct, SCAddress union case. - Regenerated src/base/generated/{curr,next}_generated.js + .d.ts (targeted muxed-contract additions only; preserved existing dts-xdr/xdrgen shape). - Address.muxedContract() + contractId()/muxedId() accessors and fromScAddress/toScAddress/toString arms. - Tests + CHANGELOG. Canonical XDR: stellar/stellar-xdr CAP-0084 SCAddress MuxedContract arm.
The SC_ADDRESS_TYPE_MUXED_CONTRACT arm was leaking into the released `curr` codec. Per the feature-flag contract a gated CAP def must be `next`-only until the protocol is enabled. Mirrors the fix on stellar/js-stellar-base#980. - xdr/curr/Stellar-contract.x + src/base/generated/curr{,_generated}.{js,d.ts}: drop the muxed-contract arm (next-channel files keep it). - src/base/address.ts: guard the fromScAddress case label with optional chaining and reach the gated members via a cast so the curr-bound Address codec no longer fails to type-check or throws when the arm is absent (the write path stays dormant until the arm lands in curr). - test/unit/base/address.test.ts: codec round-trip cases run only when the active codec defines the arm; Address-level assertions stay codec-agnostic.
Address.muxedContract's `id` param links to {@link xdr.Uint64}, which
typedoc resolves but excludes from the docs (generated xdr files are
excluded), tripping treatWarningsAsErrors. Add xdr.Uint64 to the
external-symbol mapping like the other xdr.* symbols, and regenerate the
reference docs for the new muxed-contract API.
This was referenced Jul 3, 2026
Author
This was referenced Jul 3, 2026
The Makefile pinned 68fa1ac5, which predates the CAP-0084 XDR commit,
and left XDR_FEATURES undefined, so `make generate` could not reproduce
the committed generated codec. Pin XDR_BASE_URL_{CURR,NEXT} to
stellar-xdr@787382ef (CAP-0084 muxed-contract arm) and split into
XDR_FEATURES_CURR=CAP_0083 / XDR_FEATURES_NEXT=CAP_0083,CAP_0084_MUXED_CONTRACT
so curr excludes and next includes the muxed-contract arm, mirroring
stellar/js-stellar-base#981. Drop `docker run -it` for non-TTY/CI regen
and wire the xdrgen#152 const-inlining post-process (scripts/post-process-generated.py)
for curr and next.
Regen deferred: Docker is unavailable in this environment, so
`make generate` was not re-run. The Makefile is now reproducible against
787382ef and the const post-process is wired but not yet executed; the
committed src/base/generated/* (correct CAP-0084 arm content, CI green)
are unchanged.
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.
JS SDK support for CAP-0084 (Muxed Contract Addresses).
Changes
src/base/module (address parsing/encoding + XDR arm), gated to thenextchannel. This repo vendors stellar-base rather than depending on@stellar/stellar-base, so there is no external dep to re-point.Makefile: re-pinXDR_BASE_URL_{CURR,NEXT}tostellar-xdr@787382ef(CAP-0084 head) and split feature gates —XDR_FEATURES_CURR=CAP_0083,XDR_FEATURES_NEXT=CAP_0083,CAP_0084_MUXED_CONTRACT— socurrexcludes andnextincludes the muxed-contract arm, mirroring SPIKE: Protocol 28 (CAP-0084) js-stellar-base#981. Dropdocker run -itfor non-TTY/CI, and wire the xdrgen#152 const-inlining post-process (scripts/post-process-generated.py).Deferred
make generatewas not re-run. Makefile is now reproducible against787382efand the const post-process is wired but not yet executed; committedsrc/base/generated/*are unchanged (CI green).787382efis the open stellar-xdr#307 head; re-pin to the merged/tagged SHA once the SPIKE chain lands.dist/libgitignored, built in CI).Upstream