Skip to content

SPIKE: CAP-71 support — env-var custom network + drop stale @ts-expect-error#1

Draft
sisuresh wants to merge 1 commit into
mainfrom
cap-71-p27
Draft

SPIKE: CAP-71 support — env-var custom network + drop stale @ts-expect-error#1
sisuresh wants to merge 1 commit into
mainfrom
cap-71-p27

Conversation

@sisuresh

Copy link
Copy Markdown
Owner

SPIKE: two minimal lab-source changes needed to render Protocol 27 / CAP-71 transactions.

  1. src/store/createStore.ts: parameterize defaultCustomNetwork via three new NEXT_PUBLIC_CUSTOM_{HORIZON_URL,RPC_URL,PASSPHRASE} env vars. Falls back to the existing :8000 defaults. The Quickstart-bundled lab is started with NEXT_PUBLIC_DEFAULT_NETWORK=custom but currently has no way to also supply the URLs; the only options were a hard-coded localhost:8000 (only works inside the container) or asking the user to enter them in the network UI before any deep link works.

  2. src/app/(sidebar)/transactions-explorer/tx/[tx]/components/TransactionDetails.tsx: drop a stale @ts-expect-error. With CAP-71-aware XDR types the tx.envelopeXdr.value().tx().innerTx().value().tx() expression typechecks naturally; the directive becomes "unused" and fails the Next.js production build.

Companion fork PRs:

  • sisuresh/js-stellar-base (XDR regen + inline-const post-process)
  • sisuresh/js-stellar-sdk (browser dist rebuilt against patched stellar-base)
  • sisuresh/js-stellar-xdr-json (wasm decoder at rs-stellar-xdr@a749b69b + cap_0071)

…t-error

Two minimal lab-source changes required to render Protocol 27 / CAP-71
transactions:

1. src/store/createStore.ts: parameterize defaultCustomNetwork via three
   new NEXT_PUBLIC_CUSTOM_{HORIZON_URL,RPC_URL,PASSPHRASE} env vars (falls
   back to the existing :8000 defaults). Quickstart's bundled lab is
   started with NEXT_PUBLIC_DEFAULT_NETWORK=custom but currently has no
   way to also supply the URLs; the only options were a hard-coded
   localhost:8000 (which only works inside the container) or asking the
   user to enter them in the network UI before any deep link works. With
   this PR the bundled lab can be parameterized at start time.

2. src/app/(sidebar)/transactions-explorer/tx/[tx]/components/TransactionDetails.tsx:
   drop a stale '@ts-expect-error' directive. With CAP-71-aware XDR types
   the tx.envelopeXdr.value().tx().innerTx().value().tx() expression now
   typechecks naturally; the directive becomes 'unused' and fails the
   Next.js production build.

Companion fork PRs:
  - sisuresh/js-stellar-base#... (XDR regen at .x@5187e69 with
    cap_0071+cap_0083 + inline-const post-process)
  - sisuresh/js-stellar-sdk#... (browser dist rebuilt against patched
    stellar-base)
  - sisuresh/js-stellar-xdr-json#... (wasm decoder at
    rs-stellar-xdr@a749b69b features=[cap_0071])

Used to render a live CAP-71-01 (WITH_DELEGATES) transaction end-to-end
through a local Quickstart Protocol 27 build.
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