Skip to content

Proposal: Add beginner-friendly examples to README #713

Open

Description

@goldman0020

Hi TronWeb team,

I'm a JavaScript developer and I noticed that the README could use more examples for beginners. I'd like to propose adding a simple "Getting Started" section with code examples showing:

  1. How to connect to TronWeb (with TronLink and without)
  2. How to get an account balance
  3. How to send a TRX transaction

This would help new developers adopt TronWeb more easily.

I'm willing to work on this and submit a Pull Request if you're interested.

Let me know what you think!

Activity

  1. goldman0020 commented on Jul 26, 2026

    @goldman0020
    Author

    I've already prepared a draft for this. I'll submit a PR once I get the green light from the team.

  2. Stan202310 commented on Jul 27, 2026

    @Stan202310
    Contributor

    We already have documentation for this. Feel free to check it out. https://tronweb.network/docu/docs/intro/

  3. goldman0020 commented on Jul 27, 2026

    @goldman0020
    Author

    Hi team

    Thanks for the quick reply and for pointing me to the official docs.

    You're absolutely right – the basics like installation, instantiation, and network connection are already well covered there. I should have checked more thoroughly before my initial message.

    However, while going through the docs, I noticed a few practical gaps that I believe would be valuable additions for developers who are just getting started. These are common use cases that aren't currently covered with working examples:

    What's missing:

    1. TRC-20 Token Interactions – No examples for reading token balances or transferring tokens (e.g., USDT). This is probably the most common task developers need.
    2. Error Handling Patterns – No dedicated section showing how to handle different error types (invalid address, insufficient balance, timeouts) with try/catch.
    3. Event Listening – No examples for subscribing to contract events like Transfer. This is essential for dApps.
    4. Mock Contract for Testnet – A deployable Mock USDT contract on Shasta would let developers test TRC-20 interactions without risking real funds.
    5. Quick Test Script – A ready-to-run script to verify the entire setup works.

    My plan:

    I'll prepare a focused PR that adds only these new sections to the documentation. This way, we avoid duplicating what's already there and keep the docs clean.

    The examples will be practical, copy-paste ready, and include clear security warnings (especially about private keys).

    Let me know if you're open to these additions, and I'll get the PR ready.

    Thanks for your time.

    Ali Kaharkaboodi

  4. Stan202310 commented on Jul 28, 2026

    @Stan202310
    Contributor
    1. https://tronweb.network/docu/docs/Transfer%20Token#transfer-trc20-token
    2. https://tronweb.network/docu/docs/references/error-codes
    3. We recommend polling for events yourself.
    4. You can deploy your own contracts on a Testnet.
    5. You need to implement this on your own dapp.
  5. goldman0020 commented on Jul 28, 2026

    @goldman0020
    Author

    @Stan202310 Thanks for the guidance.

    I've submitted a PR that adds a practical testing guide for TRC-20 tokens on Shasta testnet. It includes the full Solidity source code of the Mock USDT contract (since it's not verified on-chain), a complete test script, and security best practices.

    PR Link: #714

    Looking forward to your review.

  6. Stan202310 commented on Jul 29, 2026

    @Stan202310
    Contributor

    I found a demo website for TRON. Check it out: https://github.com/tronweb3/tron-dapp-quickstart

  7. goldman0020 commented on Jul 29, 2026

    @goldman0020
    Author

    @Stan202310 Thanks for the link – it's a great full‑stack DApp template.

    The goal of my PR is complementary: a minimal, copy‑paste snippet for developers to quickly verify their TronWeb setup and test TRC‑20 logic (balanceOf, transfer, mint) without the overhead of a full React/Vite project. It’s focused purely on the “TronWeb logic” itself.

    I believe having this concise example in docs/examples/ alongside the quickstart would lower the barrier for new developers – a fast way to test core concepts before building a full DApp.

    Happy to adjust anything to better fit the contribution guidelines. Let me know your thoughts!

  8. ramincsy commented on Sep 21, 2026

    @ramincsy

    Hi @goldman0020 and @Stan202310 — thanks for the careful scoping on #713 and for the Shasta Mock USDT guide in #714. Keeping it complementary to the existing docs and the tron-dapp-quickstart makes a lot of sense.

    I work with NestJS services that talk to TRON via TronWeb (balances, TRC-20 calls, exchange-style error paths). If it would help, I’d be glad to contribute a complementary NestJS-oriented example — e.g. a small injectable TronWeb provider + TRC-20 balanceOf / transfer wrapper with practical error-handling notes (invalid address, insufficient balance, node timeouts) — either as an addition alongside the Shasta guide or as a follow-up docs PR once #714 lands.

    @goldman0020 — happy to collaborate on that if you want a Nest/backend angle next to the current script-focused guide; I don’t want to step on #714. @Stan202310 — if NestJS examples belong somewhere specific in the docs tree (or should stay out of core docs), please say the word and I’ll follow your preference.

    Thanks for the maintained client and the clear redirect to existing docs earlier in the thread.

  9. goldman0020 commented on Sep 21, 2026

    @goldman0020
    Author

    Hi @ramincsy — thanks for the kind words and for offering to contribute a NestJS-oriented example. That sounds like a valuable addition to the ecosystem.

    I'm happy to collaborate on this. A backend-focused example (NestJS provider + TRC-20 wrapper with error-handling notes) would nicely complement the script-focused guide in #714 without overlapping.

    Let's wait for feedback from @Stan202310 on where it best fits in the docs tree, then we can coordinate so both contributions land cleanly.

    Looking forward to working together.

  10. Stan202310 commented on Sep 22, 2026

    @Stan202310
    Contributor
  11. ramincsy commented on Sep 23, 2026

    @ramincsy

    @goldman0020 I’d be glad to collaborate. I propose a narrowly scoped NestJS injectable TronWeb provider plus a small TRC-20 wrapper covering balanceOf and transfer, with explicit error-handling notes for configuration/connection failures, contract call or revert errors, and address/amount validation. This would be complementary to PR #714 rather than duplicate its README examples. I’m waiting for @Stan202310’s guidance on the docs tree; if core docs aren’t the right place, I can put it in a separate example repo under ramioo-labs. How would you prefer we co-author it—should I open a branch/PR, or would you prefer to own the PR and I contribute there?

  12. goldman0020 commented on Sep 24, 2026

    @goldman0020
    Author

    Hi @ramincsy — thanks for the detailed proposal. The scope you outlined (NestJS injectable provider + TRC-20 wrapper with explicit error-handling notes) sounds well-defined and complementary to #714.

    I'd be glad to see this move forward. However, I'm currently dedicating most of my time to building CryptoLance (a decentralized freelance platform on Tron), so I won't be able to own and maintain the PR myself.

    That said, I'm happy to support in a reviewer capacity. Feel free to open the branch/PR yourself and I'll review it and contribute where needed. That way, we keep the documentation flow coordinated with #714 and avoid duplication.

    Let's wait for @Stan202310's guidance on placement in the docs tree. If core docs aren't the right fit, your ramioo-labs repo could work as a good alternative.

    Looking forward to seeing it.

  13. ramincsy commented on Sep 24, 2026

    @ramincsy

    @goldman0020 Thanks — I'll own the NestJS example PR and keep it complementary to #714.

    Since @Stan202310 pointed at existing core docs for contract interact, I put the NestJS injectable provider + TRC-20 wrapper in a separate example repo (outside tronweb core docs):

    https://github.com/ramioo-labs/nestjs-tronweb-example

    I've invited you as a collaborator (pending once sudo re-auth clears). A PR with the module + error-handling notes is coming on that repo — would love your review (and a small Co-authored-by commit if you have a minute for a README tweak). No rush given CryptoLance.

    @Stan202310 — confirming this stays out of core docs as an external NestJS example.

  14. goldman0020 commented on Sep 25, 2026

    @goldman0020
    Author

    Hi @ramincsy — thanks for the invite! I've accepted it and I'm now a collaborator on the repo.

    I took a quick look at the README — the structure looks clean and the scope is well-defined. Happy to review the PR when it's ready and contribute a small Co-authored-by commit where useful.

    Given my focus on CryptoLance, my review may be slightly delayed, but I'll make sure to get to it.

    Appreciate you keeping this complementary to #714 and outside core docs as @Stan202310 suggested.

    Looking forward to the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions