Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code blocks on RPC sendTransaction page fail #1390

Open
leighmcculloch opened this issue Mar 11, 2025 · 0 comments
Open

Code blocks on RPC sendTransaction page fail #1390

leighmcculloch opened this issue Mar 11, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@leighmcculloch
Copy link
Member

leighmcculloch commented Mar 11, 2025

This issue captures a couple issues with the examples on the sendTransaction RPC page:

1‍⃣ The Python SDK guide on the RPC sendTransaction page does not work as it is missing a step.

Image

https://developers.stellar.org/docs/data/rpc/api-reference/methods/sendTransaction

It shows creating a contract invocation and then signing and submitting the transaction without calling prepare_transaction. The transaction is guaranteed to error in this case because it's not configured with fees or resources.

To make the transaction succeed, at the least you need to call the following prior to signing:

transaction = server.prepare_transaction(transaction)

2‍⃣ A second issue is that all the examples (Python, JS, Java) still wouldn't work out of the box, because they references a contract that doesn't exist. Instead of using a random increment contract, the example could be written to use the CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC contract, which is the native asset on the test network. The example could get the balance of a known predictable address such as the network root account.

The example would then create a much better developer experience, be ready to go without the developer having to navigate so many errors.

cc @stellar/platform-eng

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

1 participant