Skip to content

[Good First Issue]: Improve Explanation of examples/transfer-tokens.js #3580

@exploreriii

Description

@exploreriii

🆕🐥 First Timers Only

This issue is reserved for people who have never contributed or have made minimal contributions to Hiero.
We know that creating a pull request (PR) is a major barrier for new contributors.
The goal of this issue and all other issues in find a good first issue is to help you make your first contribution to the Hiero.

👾 Description of the issue

The example file at: examples/transfer-tokens.js
https://github.com/hiero-ledger/hiero-sdk-js/blob/main/examples/transfer-tokens.js

Is already an extensive demonstration of transferring tokens but there are a lot of nested awaits and lots of sequential content, making it unclear perhaps how it all ties together.

💡 Proposed Solution

Add an explanation at the top of the example file to outline the key steps that are done in the main() so a reader can better understand.

Additionally, we can add briefer, function-level explanations do outline what each function does.

👩‍💻 Implementation Steps

At the top of the file, add a comment:

/**
 * FULL TOKEN LIFECYCLE DEMO
 *
 * This script demonstrates the complete lifecycle of a Hedera token using the Hiero SDK:
 *
 * 1. Set up wallet
 * 2. Generate a new keypair
 * 3. Create account, sign, execute and grab the receipt
 * 4. etc
...
 */

Ensure it accurately describes all the key steps taken in main.

Optionally inside each key step in the main, we can add very short comments too, such as:

async function main() {
    /**
     * Validate required environment variables 
     */
    if (
        process.env.OPERATOR_ID == null ||
.....
    }

✅ Acceptance Criteria

To be able to merge a pull request for this issue, we need:

  • Changelog Entry: Correct changelog entry
  • Signed commits: commits must be DCO and GPG key signed
  • All Tests Pass: our workflow checks like unit and integration tests must pass
  • Issue is Solved: The implementation fully addresses the issue requirements as described above
  • No Further Changes are Made: Code review feedback has been addressed and no further changes are requested

📋 Step-by-Step Contribution Guide

If you have never contributed to an open source project at GitHub, the following step-by-step guide will introduce you to the workflow.
More information and concrete samples for shell commands for each step can be found in our CONTRIBUTING.md file.
A more detailed general documentation of the GitHub PR workflow can be found here.

  • Claim this issue: Comment below that you are interested in working on the issue
  • Wait for assignment: A community member with the given rights will add you as an assignee of the issue
  • Work on the issue: Follow the detailed description in our CONTRIBUTING.md file.
  • You did it 🎉: We will merge the fix in the main branch. Thanks for being part of the Hiero community as an open-source contributor!

IMPORTANT Your pull request CANNOT BE MERGED until your commits are each with git commit -S -s -m "chore: your commit message" with a GPG key setup.

🤔 Additional Information

If you have any questions about the topic of this issue, please ask us directly by adding a comment below.
Additionally, we invite you to join our community on our Discord server or attend our public community calls.

A general manual about open-source contributions can be found here.


Metadata

Metadata

Labels

Good First Issue CandidateIssues that can become a “good first issue” but need more description/context.

Projects

Status

👀 In Review

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions