Skip to content

Add Java examples to the learn pages - #3133

Merged
ElliotFriend merged 3 commits into
mainfrom
docs-agent/1770-java-c
Nov 13, 2026
Merged

ElliotFriend merged 3 commits into
mainfrom
docs-agent/1770-java-c

Conversation

@stellar-doxie

@stellar-doxie stellar-doxie Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Automated message from the Stellar Triage Bot.

Refs #1770

Working this because @ElliotFriend asked with /triage on #1770 and approved the stacked plan. This is Java C: Java tabs on the 6 learn/ pages that had none. Base: main (Java B, #3131, merged).

Why this matters

Readers who follow these pages in Java had no example. Now every code group on them has JavaScript, Python, Go, and Java.

Pages

  • contract-interactions/transaction-simulation: Examples 1 to 3. Example 1 adds a sendAndPoll that checks the send status, polls 30 times, and reports NOT_FOUND as "status unknown". Example 2 signs auth entries with Auth.authorizeEntry (V2 and legacy credentials).
  • storage/state-archival: the two restore methods, the same code as the Java tabs in Add Java examples to the archival, conventions, conversions, events, and RPC guides #3131 (restore-data, restore-contract). The restore branch does not add the preamble resource fee by hand, since TransactionBuilder.build() adds it (TransactionBuilder.java:195-197). One sentence says the Java SDK has both helpers and the methods go in SubmitTx.
  • fees-resource-limits-metering: the fee-bump fragment, with FeeBumpTransaction.createWithBaseFee.
  • stellar-data-structures/events: the transfer event poller. Java has no XDR-JSON request option, so it prints SCVal.toJson(), the same shape the Go tab prints.
  • data-format/xdr: Uint64, the SCAddress union, and Address.fromSCAddress, with prose for each.
  • liquidity-on-stellar-sdex-liquidity-pools: all 6 groups, as parts of one class, like the Go tab's one program.

Sweep

  • Prose that lists the SDK languages on these pages: events.mdx:190 now names Java. xdr.mdx names Java in the Uint64, union, and Address paragraphs. Searched: "Python or Go", "Python and Go", "Go SDK", "other languages", "In Go,".
  • Lines this PR changes get the Go C review fixes too: the Oxford comma at events.mdx:190 and xdr.mdx:182, and "Stellar network" at xdr.mdx:202.

Verified

  • Every Java call against java-stellar-sdk 6.0.0 source (git clone --branch 6.0.0), for example: SorobanServer.assembleTransaction keeps an operation's own auth entries (SorobanServer.java:1156); Auth.getAddressCredentials returns null for source-account entries (Auth.java:585); pollTransaction(hash) stops after 30 attempts (SorobanServer.java:344); Transaction's constructor is package-private, so Example 2 rebuilds with TransactionBuilder.

  • LiquidityPool(assetA, assetB) sets LiquidityPool.FEE (30), the only fee supported (LiquidityPool.java:19).

  • pnpm check passes (prettier, pad, mint validate, site and skill links).

  • Versions: java-stellar-sdk 6.0.0, the newest release (2026-10-28). The issue cites none. The pages pin none.

  • ElliotFriend's review: all the Java blocks compile against stellar-sdk 6.0.0, and every page ran on testnet. The lane could not run them (javac and java need approval).

  • xdr.mdx:70 names Python, Go, and Java, from that review's suggestion.

Not verified

  • The liquidity pool watch block and the fees block are fragments by design.
  • javadoc.io serves stellar-sdk 4.0.0 as "latest" and has no 6.0.0 pages, so the Java reference link in xdr.mdx points at SCAddress.java at the 6.0.0 tag.

Stack

@stellar-doxie

stellar-doxie Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Automated message from the Stellar Triage Bot.

Reviewing my own PR before hand-off. Thanks for the rebases, @ElliotFriend.

Verified against java-stellar-sdk 6.0.0, and the checks pass at 330af0d9. I fixed one Java restore fee bug. Decision: the Java blocks were not compiled or run. Can you run them, or accept them unrun? @kaankacar @ElliotFriend
Merge #3126, #3127, and #3131 first. (hold: stellar/github-triage-bot#101)

What I checked
  • Pushed 330af0d9 (e9d8937b before your rebase): state-archival, Java restore branch. It added getMinResourceFee() to the base fee, and TransactionBuilder.build() adds the preamble's resource fee again (TransactionBuilder.java:195-197). Now the same as Add Java examples to the archival, conventions, conversions, events, and RPC guides #3131's restore-data tab.
  • Your rebases: git range-diff shows my commits unchanged. The new base touches none of the 6 pages.
  • Java calls checked against java-stellar-sdk 6.0.0 source (newest, 2026-10-28; the pages pin 6.0.0; the issue cites none):
    • Auth.authorizeEntry(entry, KeyPair, Long, Network) (Auth.java:129), getAddressCredentials null for source-account entries (:585).
    • assembleTransaction keeps an operation's own auth (SorobanServer.java:1126), pollTransaction (:344).
    • FeeBumpTransaction.createWithBaseFee (:78), LiquidityPool(a, b) uses FEE 30 (LiquidityPool.java:19, :67).
    • XdrUnsignedHyperInteger(Long|BigInteger), SCAddress arm getters, Address.fromSCAddress and toString (Address.java:131, :319), EventInfo.parseTopic/parseValue, SCVal.toJson.
  • restoreContract on state-archival is identical to Add Java examples to the archival, conventions, conversions, events, and RPC guides #3131's restore-contract tab.
  • Every code group on the 6 pages ends JavaScript, Python, Go, Java. Language lists name Java at events.mdx:190 and xdr.mdx:70, :182, :202.
  • Outside this PR: the JavaScript and Python restore tabs still add the resource fee twice. Filed JavaScript and Python restore examples pay the restore resource fee twice #3134.
  • Checks at 330af0d9: checks, CodeQL, and Socket pass. No live preview: Mintlify Deployment skips on a stacked base.
  • PR body: updated the base SHA, the restore-fee line, and the stack notes.

@ElliotFriend
ElliotFriend force-pushed the docs-agent/1770-java-c branch from 330af0d to a955ca4 Compare November 13, 2026 19:29
Base automatically changed from docs-agent/1770-java-b to main November 13, 2026 19:32
Adds Java tabs to transaction simulation, state archival, fees, events, XDR, and liquidity pools, checked against java-stellar-sdk 6.0.0.
TransactionBuilder.build() adds the restore preamble's resource fee, so the Java restore branch no longer adds minResourceFee by hand. This matches the restore-data Java tab.
@mintlify

mintlify Bot commented Nov 13, 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 13, 2026, 7:42 PM

@ElliotFriend

Copy link
Copy Markdown
Contributor

hi there, bot! you've been doing great work with these PRs. yes, i'll make sure to compile and run the java blocks before i review/approve the PR

@ElliotFriend ElliotFriend left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the Java blocks compile against stellar-sdk 6.0.0, and every page ran on testnet. One wording fix inline. Thanks!

For the other XDR types, see the [v17 XDR migration guide](https://stellar.github.io/js-stellar-sdk/migration/xdr-migration/). It shows the v17 shapes of unions, enums, integers, and bytes, so it should be your primary guide to navigating the XDR if you're using JavaScript.

Python and Go have no such variations. Python (see `stellar-sdk`'s [uint64.html](https://stellar-sdk.readthedocs.io/en/stable/_modules/stellar_sdk/xdr/uint64.html) documentation) supports arbitrarily-sized integers by default. In Go, `xdr.Uint64` is a named `uint64` type, so a plain conversion works:
Python and Go have no such variations. Python (see `stellar-sdk`'s [uint64.html](https://stellar-sdk.readthedocs.io/en/stable/_modules/stellar_sdk/xdr/uint64.html) documentation) supports arbitrarily-sized integers by default. In Go, `xdr.Uint64` is a named `uint64` type, so a plain conversion works. In Java, `Uint64` wraps an `XdrUnsignedHyperInteger`, which takes a `Long` or, for values above `Long.MAX_VALUE`, a `BigInteger`:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Java has no SDK-version variation either, and the rest of this paragraph covers it.

Suggested change
Python and Go have no such variations. Python (see `stellar-sdk`'s [uint64.html](https://stellar-sdk.readthedocs.io/en/stable/_modules/stellar_sdk/xdr/uint64.html) documentation) supports arbitrarily-sized integers by default. In Go, `xdr.Uint64` is a named `uint64` type, so a plain conversion works. In Java, `Uint64` wraps an `XdrUnsignedHyperInteger`, which takes a `Long` or, for values above `Long.MAX_VALUE`, a `BigInteger`:
Python, Go, and Java have no such variations. Python (see `stellar-sdk`'s [uint64.html](https://stellar-sdk.readthedocs.io/en/stable/_modules/stellar_sdk/xdr/uint64.html) documentation) supports arbitrarily-sized integers by default. In Go, `xdr.Uint64` is a named `uint64` type, so a plain conversion works. In Java, `Uint64` wraps an `XdrUnsignedHyperInteger`, which takes a `Long` or, for values above `Long.MAX_VALUE`, a `BigInteger`:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Automated message from the Stellar Triage Bot.

Back on this because @ElliotFriend reviewed.

Applied as suggested in 53b48b72. xdr.mdx:70 now names Python, Go, and Java.

Applies the review suggestion on xdr.mdx: the Uint64 paragraph now names Python, Go, and Java.
@stellar-doxie stellar-doxie Bot added bot:ready-to-merge Bot verified and approved; waiting for a maintainer to merge and removed bot:needs-decision Bot needs a maintainer decision (listing, scope, policy) labels Nov 13, 2026
@stellar-doxie

stellar-doxie Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Automated message from the Stellar Triage Bot.

Back on this because @ElliotFriend replied and reviewed.

Your approval is on 8879a84f. The only change since is your xdr.mdx:70 suggestion, in 53b48b72. Checks pass and the preview renders. Ready to merge.

What I checked
  • Rebase after Add Go examples to the tokens and Horizon error and pagination pages #3126, Add Java examples to the transactions and basics guides #3127, and Add Java examples to the archival, conventions, conversions, events, and RPC guides #3131 merged: git range-diff shows both commits unchanged. main's docs/ equals the Java B tip the restore tabs were copied from.
  • Spot-checked against java-stellar-sdk 6.0.0 (newest, 2026-10-28; the pages pin 6.0.0; the issue cites none): assembleTransaction subtracts the old resource fee and keeps an operation's own auth (SorobanServer.java:1133-1160), TransactionBuilder.build() adds the resource fee (:196-197), Auth.getAddressCredentials (:585), FeeBumpTransaction.createWithBaseFee (:78), LiquidityPool.FEE 30 (:19).
  • Your review covers the run: all Java blocks compile against 6.0.0, and every page ran on testnet.
  • Preview at 53b48b72: the 6 pages return 200. Every new Java block is served. xdr.mdx:70 shows the new wording.
  • Checks at 53b48b72: checks, Mintlify Deployment, CodeQL, and Socket pass. mint broken-links found none.
  • Sweep: the language lists on the 6 pages name Java.
  • Hold stellar/github-triage-bot#101: I noted your answer there and left it open for you to close.
  • PR body: base and stack notes updated.

@ElliotFriend
ElliotFriend merged commit ebe4e0a into main Nov 13, 2026
8 checks passed
@ElliotFriend
ElliotFriend deleted the docs-agent/1770-java-c branch November 13, 2026 20:39

This branch was successfully deployed

1 active deployment
staging — 53b48b72 Deployed Nov 13, 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant