Skip to content

Fix signing and submission in the archival and simulation examples - #2933

Merged
ElliotFriend merged 2 commits into
mainfrom
2906-build-assembled-tx-before-signing
Nov 2, 2026
Merged

ElliotFriend merged 2 commits into
mainfrom
2906-build-assembled-tx-before-signing

Conversation

@kaankacar

Copy link
Copy Markdown
Contributor

Closes #2906

What

  • docs/build/guides/archival/restore-data-js.mdx and docs/learn/fundamentals/contract-development/storage/state-archival.mdx ("My data is archived!"): call .build() on the assembleTransaction() result before signing. Import Operation. Set time bounds on the restore transaction.
  • docs/build/guides/transactions/submit-transaction-wait-js.mdx: submitTx now returns or throws finalStatus.
  • docs/learn/fundamentals/contract-development/contract-interactions/transaction-simulation.mdx, Examples 1 and 2:
    • Use new Server(), getAccount(), named invokeContractFunction arguments, time bounds and await. Fix the imports.
    • Example 2 selects the signer with SDK 17 XDR fields, signs auth entries with Promise.all(), uses simResult.latestLedger for the expiration, and builds before signing.

Verification

  • @stellar/stellar-sdk 17.2.1 with local RPC fixtures: 44 of 44 checks pass. The original code fails as the issue says. The fixed code passes both archival branches, all submitTx outcomes, and Examples 1 to 3.
  • Testnet, SDK 17.2.1: Examples 1, 2 and 3 succeeded (txs 4639bdeca92fe9eb5bb1f788688c5e95d92601f066a89a81c72fa3899944b282, 7a2e994b4c332a1fdd787dfac78681b88fa2635c756cb33bfb71bfb77ef7ae3b, ab3b538b5bfd709f28d09c0f1e5c8305ab971b3a412e4b9eeb795ba49cba1d3d).
  • Testnet simulation returns sorobanCredentialsAddressV2 for address auth. Example 2 handles that type and the legacy type.
  • tsc --strict passes on the fixed snippets. pnpm check:mdx, scripts/check-relative-links.sh and an MDX compile pass.

Notes

  • Follow-up: the "My contract is archived!" example in state-archival.mdx does not parse. It also uses pre-v17 XDR getters, has no time bounds, and reads the WASM hash from a ledger key. It needs its own rewrite.
  • Follow-up: the archival snippets redeclare Api when you combine them with the submitTx guide imports.

The archival examples signed the builder from assembleTransaction and
used Operation without an import. The restore transaction had no time
bounds. The submitTx helper returned and threw undefined names. The
simulation examples called Server() without new and missed awaits.
The multi-party example also used removed XDR getters. All examples
now build before signing and run on SDK 17.2.1.

Closes #2906
@kaankacar

Copy link
Copy Markdown
Contributor Author

/triage

@github-actions github-actions Bot added the preview Preview builds for PRs by SDF employees. label Oct 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

@stellar-triage-bot stellar-triage-bot Bot added the bot:ready-to-merge Bot verified and approved; waiting for a maintainer to merge label Oct 21, 2026
@stellar-triage-bot

Copy link
Copy Markdown
Contributor

🤖 Automated message from the Stellar Triage Bot.

Reviewing because @kaankacar asked with /triage.

Verified: the fixed calls match the @stellar/stellar-sdk 17.2.1 typings, and the three testnet transactions succeeded. All checks are green and the preview renders the new code. Ready to merge.

Note: Example 2 now uses SDK 17 XDR fields, so it needs SDK 17 (the current latest).

@mintlify

mintlify Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
stellar-docs 🟢 Ready View Preview Nov 2, 2026, 6:23 PM

@ElliotFriend
ElliotFriend merged commit 50531cb into main Nov 2, 2026
9 checks passed
@ElliotFriend
ElliotFriend deleted the 2906-build-assembled-tx-before-signing branch November 2, 2026 18:27

This branch was successfully deployed

1 active deployment
staging — 76e5cef4 Deployed Nov 2, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:ready-to-merge Bot verified and approved; waiting for a maintainer to merge preview Preview builds for PRs by SDF employees.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build assembled transactions before signing in the archival and simulation examples

2 participants