Skip to content

SPIKE: Protocol 28 (CAP-0084)#979

Closed
sisuresh wants to merge 1 commit into
stellar:masterfrom
sisuresh:p28-cap-0084
Closed

SPIKE: Protocol 28 (CAP-0084)#979
sisuresh wants to merge 1 commit into
stellar:masterfrom
sisuresh:p28-cap-0084

Conversation

@sisuresh

Copy link
Copy Markdown

SPIKE: bump js-stellar-base for Protocol 28 / CAP-0084 (muxed contract addresses).

Changes

  • XDR regenerated against stellar-xdr@2769fed (PR WIP: feat(typescript): add XDR typings #305 head) with the CAP_0084 feature gate; new SC_ADDRESS_TYPE_MUXED_CONTRACT arm + MuxedContract { uint64 id; ContractID contractId; }.
  • Address gains muxedContract(contractId, id), fromScAddress/toScAddress round-trip, contractId()/muxedId() accessors, <C-strkey>:<id> display. toBuffer() throws for this arm.
  • Regenerated types/{curr,next}.d.ts + public Address typings; new muxed-contract unit tests + CHANGELOG.

Deferred

  • Canonical muxed-contract strkey (display string not yet parsable back via Address ctor) — pending upstream standardization; mirrors go-stellar-sdk.

Links

- Bump XDR rev pin (curr+next) to stellar/stellar-xdr@2769fed (PR stellar#305 head)
  carrying the CAP_0084 #ifdef gate; add CAP_0084 to XDR_FEATURES and the
  `stellar-xdr xfile preprocess --features` step on the .x fetch rules.
- New XDR: SCAddressType.SC_ADDRESS_TYPE_MUXED_CONTRACT=5, struct
  MuxedContract { uint64 id; ContractID contractId; }, SCAddress muxedContract
  arm. curr/next regenerated byte-identical.
- Make generated-JS const inlining reproducible and terser-safe:
  scripts/post-process-generated.py inlines bare const use sites
  (xdr.string(SCSYMBOL_LIMIT) -> xdr.string(32)) so terser cannot DCE an
  unbound identifier; wired as a post-xdrgen Makefile step for curr and next.
- Regenerate types/{curr,next}.d.ts with MuxedContract; patch the dts Makefile
  recipes (node:lts-alpine + apk add yarn, drop -it).
- Address now decodes/encodes the muxed-contract arm: Address.muxedContract(),
  fromScAddress/toScAddress round-trip (uint64 preserved as xdr.Uint64),
  contractId()/muxedId() accessors, <C-strkey>:<id> display, toBuffer() throws.
  Public typings (types/index.d.ts, types/test.ts) and unit tests added.

Deferred: a canonical muxed-contract *strkey* (so the display string isn't
constructor-parsable) — pending upstream standardization; mirrors
go-stellar-sdk#1, which has the same residual gap.
@sisuresh sisuresh closed this Jun 26, 2026
@sisuresh sisuresh deleted the p28-cap-0084 branch June 26, 2026 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant