Repository navigation
Add Java examples to the learn pages - #3133
Conversation
3b9bb8e to
d94898e
Compare
e9d8937 to
330af0d
Compare
|
🤖 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 What I checked
|
330af0d to
a955ca4
Compare
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.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
a955ca4 to
8879a84
Compare
|
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
left a comment
There was a problem hiding this comment.
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`: |
There was a problem hiding this comment.
Java has no SDK-version variation either, and the rest of this paragraph covers it.
| 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`: |
There was a problem hiding this comment.
🤖 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.
|
🤖 Automated message from the Stellar Triage Bot. Back on this because @ElliotFriend replied and reviewed. Your approval is on What I checked
|
🤖 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 asendAndPollthat checks the send status, polls 30 times, and reportsNOT_FOUNDas "status unknown". Example 2 signs auth entries withAuth.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, sinceTransactionBuilder.build()adds it (TransactionBuilder.java:195-197). One sentence says the Java SDK has both helpers and the methods go inSubmitTx.fees-resource-limits-metering: the fee-bump fragment, withFeeBumpTransaction.createWithBaseFee.stellar-data-structures/events: thetransferevent poller. Java has no XDR-JSON request option, so it printsSCVal.toJson(), the same shape the Go tab prints.data-format/xdr:Uint64, theSCAddressunion, andAddress.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
events.mdx:190now names Java.xdr.mdxnames Java in theUint64, union, andAddressparagraphs. Searched: "Python or Go", "Python and Go", "Go SDK", "other languages", "In Go,".events.mdx:190andxdr.mdx:182, and "Stellar network" atxdr.mdx:202.Verified
Every Java call against java-stellar-sdk 6.0.0 source (
git clone --branch 6.0.0), for example:SorobanServer.assembleTransactionkeeps an operation's own auth entries (SorobanServer.java:1156);Auth.getAddressCredentialsreturns 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 withTransactionBuilder.LiquidityPool(assetA, assetB)setsLiquidityPool.FEE(30), the only fee supported (LiquidityPool.java:19).pnpm checkpasses (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-sdk6.0.0, and every page ran on testnet. The lane could not run them (javacandjavaneed approval).xdr.mdx:70names Python, Go, and Java, from that review's suggestion.Not verified
xdr.mdxpoints atSCAddress.javaat the 6.0.0 tag.Stack
mainwith no content change (git range-diff: both commits unchanged).events.mdx), 💻 Convert low-res Soroban fee diagram to Mermaid #2407 (fees-resource-limits-metering.mdx), 🧮 Manage data public info #1496 (state-archival.mdx). None adds code tabs.