You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
json-rpc code snippets should use stellar sdks #441
Currently the code snippets use general purpose dependencies (like json and requests in python).
However, if we expect developers to be using the respective SDKs (like stellar-sdk in python), which I think is a reasonable assumption, we should demonstrate how that's done with them instead.
I think it's helpful that we have some raw examples for how to interact with what is a simple http server. People don't need to use an SDK to talk to a http server.
If we do add examples with the SDKs, it'd be helpful to keep the cURL and JSON tabs at least, if not the others too.
Yes, the cURL and JSON examples should remain as is, that's sufficient information for anyone who doesn't want to use an SDK.
The JS, Python and any other programming language we add should use the canonical SDK. This is consistent with the current code examples in the non-soroban docs.
@leighmcculloch@tomerweller I think the sub-tabs would indeed be "unnecessary complexity" in our circumstance. The way we make these tabs currently is a hack of a customization using a patch on a metamask package. I think trying to shove in some sub-tabs would make it even more complex and unwieldy. To be honest, it's possible we're already deep into "unnecessary complexity" territory lol
I really like the idea of using the SDKs though for the JS/Python/etc. examples, though. Really smart!
@mollykarcher I see this issue was closed, but looking at the docs, it looks like it was only completed for 3 of the 12 endpoints. For example, I only see examples for these endpoints:
getTransaction
sendTransaction
getLedgerEntries
Was there discussion about adding SDK examples to the other 9 endpoints? I don't see any discussion here on this issue on reasoning to only do a couple or what the plan is.
At the very least it'd be worthwhile adding SDK examples for the simulateTransaction, getEvents, getLedgers, and getTransactions methods.
Note that I've opened these follow up bugs regarding the existing examples that were added:
Apologies, should have added a comment when closing; we were discussing this one amongst a handful of other topics on a call. I will caveat everything I'm about to say with, I don't feel incredibly strongly about keeping this ticket open, we just won't necessarily work it for this platform docpocolypse, so we could re-open and just keep removed from the board.
I don't think examples using the SDKs should live in this section of the docs at all, but my reasons are mostly logistical:
They have a tendency to get out-of-date quickly and we don't update them on any real regular cadence (as is clear based on the other issues you referenced)
Maintaining these examples is burdensome and manual (as described by Elliot/Simon in this thread)
The non-SDK examples are auto-generated with the spec
I personally think the visual combo of raw/non-SDK examples on top, and SDK examples on bottom looks clunky/busy on the page and hurts discoverability of the SDK examples. Until you referenced those endpoints that had examples, I actually didn't even realize we had SDK examples on any live pages because I don't think I'd ever scrolled that far down 😅 (I was going off an example that simon had screenshared where he added some of these).
All of the SDKs have docs pages that are owned by the maintainers of the SDKs and generated/published in their languages respective doc format. I haven't audited any of these and it looks like some of them are solid and some of them are less solid. But to me this feels like the more appropriate place for SDK examples to do, and the place where they're more likely to be kept up to date since the updates live with their maintainers. We can also ask for better docs from these maintainers if we want.
However, thinking about this as a product, and being a developer reading the docs, well maintained SDK examples would improve developer experience, something akin to:
I understand that most of the SDKs are open source projects with their own maintainers. I don't think we need to provide examples of all of them though. At the least we could provide JS+Python, or as a stretch, JS+Python+Java+Go. After all, we maintain the JS+Go ones, we should be experts in them.
If those SDKs already have solid example docs, like the Python SDK has here, we could also link out directly to them.
But even the SDKs that have solid docs, they don't necessarily have solid example docs, which are helpful at getting people started. For example, the JS Stellar SDK: that's maintained by us, it's own docs are pretty difficult to navigate as a newcomer, and doesn't have clear example documentation like what was proposed here, so it's lacking too.
I actually didn't even realize we had SDK examples on any live pages because I don't think I'd ever scrolled that far down 😅 (I was going off an example that simon had screenshared where he added some of these).
I also didn't realize that there were sdk examples in some endpoints
Hi @chowbao 👋 I'm doing a triage pass over our open issues, and this one hasn't seen activity in a while. Two quick questions:
Is this still relevant / still on your radar?
Is there anything you need to move it forward — review, context, a decision, someone to pair with?
If it's no longer on your plate, no worries at all — just say the word and we'll open it up for other contributors. If I don't hear back in a couple weeks, I'll free up the assignment so it doesn't look claimed.
🤖 Automated message from Kaan's Automated Triage Bot.
Decision needed: do the RPC API reference pages carry SDK code examples, and if so for which methods?
Molly and Leigh disagreed on this in March 2025. Nobody settled it. Molly closed the issue, then reopened it in September 2025. Elliot freed the assignment on 2026-08-03.
What I checked on main (09152f8e, read 2026-09-07):
This is the same 3-of-12 split Leigh reported in March 2025. Nothing moved since.
Two facts have changed since the discussion:
The sub-tab objection is now out of date. Elliot cited a patch on a MetaMask package. That patch is gone. The site now uses @stellar/open-rpc-docs-react 0.2.1, which SDF owns and publishes.
Molly's maintenance point is correct. The SDK examples are hand-written MDX below the generated <RpcMethod> component. The spec build does not touch them.
Options:
Complete the set. Add SDK examples to the 9 remaining methods.
Do Leigh's narrower version. Add JS and Python only, and only to simulateTransaction, getEvents, getLedgers and getTransactions.
Link out instead. Replace the 3 SDK sections with links to the Build > Guides pages and the SDK docs.
Remove the SDK examples. Keep cURL and JSON only. This is Molly's position.
I can build options 1, 2 or 3. Please also say which languages to keep. The current 3 pages use Python, JS and Java.
The status quo is the one option I recommend against. 3 of 12 pages is inconsistent, and it hides the examples that do exist.
Activity
leighmcculloch commentedon Feb 22, 2024
Link?
leighmcculloch commentedon Feb 22, 2024
Ah these pages?
Ref: https://soroban.stellar.org/api/methods/getHealth
I think it's helpful that we have some raw examples for how to interact with what is a simple http server. People don't need to use an SDK to talk to a http server.
If we do add examples with the SDKs, it'd be helpful to keep the cURL and JSON tabs at least, if not the others too.
tomerweller commentedon Feb 22, 2024
Yes, the cURL and JSON examples should remain as is, that's sufficient information for anyone who doesn't want to use an SDK.
The JS, Python and any other programming language we add should use the canonical SDK. This is consistent with the current code examples in the non-soroban docs.
leighmcculloch commentedon Feb 22, 2024
Or possibly add sub tabs with / without sdk.
tomerweller commentedon Feb 22, 2024
sounds like unnecessary complexity to me
ElliotFriend commentedon Feb 22, 2024
@leighmcculloch @tomerweller I think the sub-tabs would indeed be "unnecessary complexity" in our circumstance. The way we make these tabs currently is a hack of a customization using a patch on a metamask package. I think trying to shove in some sub-tabs would make it even more complex and unwieldy. To be honest, it's possible we're already deep into "unnecessary complexity" territory lol
I really like the idea of using the SDKs though for the JS/Python/etc. examples, though. Really smart!
ElliotFriend commentedon Feb 22, 2024
For the record, here's the patch file I was referring to: https://github.com/stellar/soroban-docs/blob/aa79eff15d82367e3097b5f53525ccda3d50434a/patches/%40metamask%2Bopen-rpc-docs-react%2B0.1.2.patch
[Soroban Merge] Create a "Smart Contracts" section (#388)
3 remaining items
leighmcculloch commentedon Mar 11, 2025
@mollykarcher I see this issue was closed, but looking at the docs, it looks like it was only completed for 3 of the 12 endpoints. For example, I only see examples for these endpoints:
getTransactionsendTransactiongetLedgerEntriesWas there discussion about adding SDK examples to the other 9 endpoints? I don't see any discussion here on this issue on reasoning to only do a couple or what the plan is.
At the very least it'd be worthwhile adding SDK examples for the
simulateTransaction,getEvents,getLedgers, andgetTransactionsmethods.Note that I've opened these follow up bugs regarding the existing examples that were added:
getLedgerEntriespage are confusing #1385sendTransactionpage fail #1390mollykarcher commentedon Mar 11, 2025
Apologies, should have added a comment when closing; we were discussing this one amongst a handful of other topics on a call. I will caveat everything I'm about to say with, I don't feel incredibly strongly about keeping this ticket open, we just won't necessarily work it for this platform docpocolypse, so we could re-open and just keep removed from the board.
I don't think examples using the SDKs should live in this section of the docs at all, but my reasons are mostly logistical:
leighmcculloch commentedon Mar 11, 2025
🤔 These are all great points.
What we have here today with the raw JSON-RPC exampes is similar to what the Ethereum documentation publish:
https://ethereum.org/en/developers/docs/apis/json-rpc/
However, thinking about this as a product, and being a developer reading the docs, well maintained SDK examples would improve developer experience, something akin to:
https://docs.stripe.com/api/errors/handling?lang=python
I understand that most of the SDKs are open source projects with their own maintainers. I don't think we need to provide examples of all of them though. At the least we could provide JS+Python, or as a stretch, JS+Python+Java+Go. After all, we maintain the JS+Go ones, we should be experts in them.
If those SDKs already have solid example docs, like the Python SDK has here, we could also link out directly to them.
But even the SDKs that have solid docs, they don't necessarily have solid example docs, which are helpful at getting people started. For example, the JS Stellar SDK: that's maintained by us, it's own docs are pretty difficult to navigate as a newcomer, and doesn't have clear example documentation like what was proposed here, so it's lacking too.
chowbao commentedon Mar 11, 2025
I also didn't realize that there were sdk examples in some endpoints
ElliotFriend commentedon Jul 13, 2026
Hi @chowbao 👋 I'm doing a triage pass over our open issues, and this one hasn't seen activity in a while. Two quick questions:
If it's no longer on your plate, no worries at all — just say the word and we'll open it up for other contributors. If I don't hear back in a couple weeks, I'll free up the assignment so it doesn't look claimed.
kaankacar commentedon Sep 7, 2026
🤖 Automated message from Kaan's Automated Triage Bot.
I am looking at this issue now. I will report what I find.
kaankacar commentedon Sep 7, 2026
🤖 Automated message from Kaan's Automated Triage Bot.
Decision needed: do the RPC API reference pages carry SDK code examples, and if so for which methods?
Molly and Leigh disagreed on this in March 2025. Nobody settled it. Molly closed the issue, then reopened it in September 2025. Elliot freed the assignment on 2026-08-03.
What I checked on
main(09152f8e, read 2026-09-07):getTransaction,sendTransaction,getLedgerEntries.simulateTransaction,getEvents,getLedgers,getTransactions,getHealth,getNetwork,getFeeStats,getLatestLedger,getVersionInfo.Two facts have changed since the discussion:
@stellar/open-rpc-docs-react0.2.1, which SDF owns and publishes.Molly's maintenance point is correct. The SDK examples are hand-written MDX below the generated
<RpcMethod>component. The spec build does not touch them.Options:
simulateTransaction,getEvents,getLedgersandgetTransactions.I can build options 1, 2 or 3. Please also say which languages to keep. The current 3 pages use Python, JS and Java.
The status quo is the one option I recommend against. 3 of 12 pages is inconsistent, and it hides the examples that do exist.
@kaankacar @ElliotFriend